|
@@ -603,7 +603,7 @@ namespace ComPDFKit.Tool.DrawTool
|
|
|
return maxRect;
|
|
|
}
|
|
|
|
|
|
- public void SetAnnotData(AnnotData annotData)
|
|
|
+ public void SetAnnotData(AnnotData annotData, CPDFViewer viewer)
|
|
|
{
|
|
|
SetIgnorePoints(new List<PointControlType>());
|
|
|
SetIsProportionalScaling(false);
|
|
@@ -638,9 +638,33 @@ namespace ComPDFKit.Tool.DrawTool
|
|
|
default:
|
|
|
break;
|
|
|
}
|
|
|
+
|
|
|
SetMaxRect(annotData.PaintOffset);
|
|
|
- SetRect(annotData.PaintRect, annotData.CurrentZoom);
|
|
|
- SetRotation(annotData.Rotation);
|
|
|
+ if(annotData.AnnotType == C_ANNOTATION_TYPE.C_ANNOTATION_STAMP)
|
|
|
+ {
|
|
|
+ CRect sourceRect = new CRect();
|
|
|
+ annotData.Annot.GetSourceRect(ref sourceRect);
|
|
|
+ if (!sourceRect.IsEmpty)
|
|
|
+ {
|
|
|
+ RenderData renderData = viewer.GetCurrentRenderPageForIndex(annotData.PageIndex);
|
|
|
+ Rect zoomRect = new Rect(sourceRect.left / 72 * 96 * annotData.CurrentZoom, sourceRect.top / 72 * 96 * annotData.CurrentZoom, sourceRect.width() / 72 * 96 * annotData.CurrentZoom, sourceRect.height() / 72 * 96 * annotData.CurrentZoom);
|
|
|
+ Rect rotateRect = zoomRect;
|
|
|
+ rotateRect.X += renderData.PageBound.X - renderData.CropLeft * annotData.CurrentZoom;
|
|
|
+ rotateRect.Y += renderData.PageBound.Y - renderData.CropTop * annotData.CurrentZoom;
|
|
|
+ SetRect(rotateRect, annotData.CurrentZoom);
|
|
|
+ rotateAngle = (annotData.Annot as CPDFStampAnnotation).AnnotationRotator.GetRotation();
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ SetRect(annotData.PaintRect, annotData.CurrentZoom);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ SetRect(annotData.PaintRect, annotData.CurrentZoom);
|
|
|
+ }
|
|
|
+
|
|
|
+ //SetRotation(annotData.Rotation);
|
|
|
selectedRectData = new SelectedAnnotData();
|
|
|
selectedRectData.annotData = annotData;
|
|
|
}
|