|
@@ -127,7 +127,40 @@ namespace ComPDFKit.Tool
|
|
|
|
|
|
protected bool AnnotHitTest()
|
|
|
{
|
|
|
- BaseAnnot baseAnnot = PDFViewer.AnnotHitTest(true);
|
|
|
+ BaseAnnot baseAnnot = null;
|
|
|
+ if (canRotateAnnot)
|
|
|
+ {
|
|
|
+ //baseAnnot = PDFViewer.AnnotHitTest();
|
|
|
+ //if (baseAnnot == null)
|
|
|
+ {
|
|
|
+ Point position = Mouse.GetPosition(PDFViewer);
|
|
|
+ HitTestResult hitTestResult = VisualTreeHelper.HitTest(PDFViewer, position);
|
|
|
+ if (hitTestResult != null)
|
|
|
+ {
|
|
|
+ if(hitTestResult.VisualHit is BaseAnnot)
|
|
|
+ {
|
|
|
+ baseAnnot = hitTestResult.VisualHit as BaseAnnot;
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ AnnotLayer annotLayer = PDFViewer.GetViewForTag(PDFViewer.GetAnnotViewTag()) as AnnotLayer;
|
|
|
+ if(annotLayer!= null)
|
|
|
+ {
|
|
|
+ hitTestResult= VisualTreeHelper.HitTest(annotLayer, position);
|
|
|
+ }
|
|
|
+ if(hitTestResult != null && hitTestResult.VisualHit is BaseAnnot)
|
|
|
+ {
|
|
|
+ baseAnnot = hitTestResult.VisualHit as BaseAnnot;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ baseAnnot= PDFViewer.AnnotHitTest(true);
|
|
|
+ }
|
|
|
+
|
|
|
if (baseAnnot != null)
|
|
|
{
|
|
|
if ((baseAnnot as BaseWidget) != null)
|