PDF Viewer not Refreshing Properly
Posted: Wed Nov 30, 2016 9:54 pm
I am seeing a bug with PDF editor not properly redrawing a line annotation. In the images provided, a line segment is visible on the UI after updating a line. This stray line segment cannot be selected and disappears when the zoom level changes, however when I go back to the same zoom, the line segment appears again.
orignalPlacement.PNG shows the original position of the line.
draggedPlacement.PNG shows the new position of the line with the stray fragment as well.
zoomedPlacemnt.PNG shows what happens when zoomed in from draggedPlacement.png.
Do you have any other techniques for redrawing a line annotation that will get rid of the stray line segment?
The application is configured as such:
When the orange annotation is moved, the line annotation is adjusted to snap to the center of the orange annotation.
This is done be changing the end points on the line.
IPXC_AnnotData_Line lineData = (IPXC_AnnotData_Line)lineAnnot.Data;
PXC_Point elementPoint;
PXC_Point flagPoint;
lineData.GetLinePoints(out elementPoint, out flagPoint);
// new center point
PXC_Rect newLocation = annot.get_Rect();
flagPoint = new PXC_Point()
{
x = (newLocation.left + newLocation.right) / 2,
y = (newLocation.top + newLocation.bottom) / 2
};
lineData.SetLinePoints(ref elementPoint, ref flagPoint);
lineAnnot.Data = lineData;
PDFXEdit.IPXV_InvalidatePagesInfo ipi = viewer.PdfCtrl.Doc.CreateInvPagesInfo();
ipi.InvalidateAnnot(lineAnnot);
viewer.PdfCtrl.Doc.InvalidatePages(ipi);
viewer.PdfCtrl.Doc.FireAnnotChangedEvent(lineAnnot);
tagRECT viewRect = viewer.PdfCtrl.Doc.ActiveView.PagesView.Obj.ClientRect;
viewer.PdfCtrl.Doc.ActiveView.PagesView.RedrawRect(ref viewRect);
viewer.PdfCtrl.Doc.ActiveView.PagesView.Redraw();
orignalPlacement.PNG shows the original position of the line.
draggedPlacement.PNG shows the new position of the line with the stray fragment as well.
zoomedPlacemnt.PNG shows what happens when zoomed in from draggedPlacement.png.
Do you have any other techniques for redrawing a line annotation that will get rid of the stray line segment?
The application is configured as such:
When the orange annotation is moved, the line annotation is adjusted to snap to the center of the orange annotation.
This is done be changing the end points on the line.
IPXC_AnnotData_Line lineData = (IPXC_AnnotData_Line)lineAnnot.Data;
PXC_Point elementPoint;
PXC_Point flagPoint;
lineData.GetLinePoints(out elementPoint, out flagPoint);
// new center point
PXC_Rect newLocation = annot.get_Rect();
flagPoint = new PXC_Point()
{
x = (newLocation.left + newLocation.right) / 2,
y = (newLocation.top + newLocation.bottom) / 2
};
lineData.SetLinePoints(ref elementPoint, ref flagPoint);
lineAnnot.Data = lineData;
PDFXEdit.IPXV_InvalidatePagesInfo ipi = viewer.PdfCtrl.Doc.CreateInvPagesInfo();
ipi.InvalidateAnnot(lineAnnot);
viewer.PdfCtrl.Doc.InvalidatePages(ipi);
viewer.PdfCtrl.Doc.FireAnnotChangedEvent(lineAnnot);
tagRECT viewRect = viewer.PdfCtrl.Doc.ActiveView.PagesView.Obj.ClientRect;
viewer.PdfCtrl.Doc.ActiveView.PagesView.RedrawRect(ref viewRect);
viewer.PdfCtrl.Doc.ActiveView.PagesView.Redraw();