|
@@ -352,7 +352,7 @@ namespace ComPDFKit.Tool
|
|
|
{
|
|
|
return;
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
if (!HitTestBorder())
|
|
|
{
|
|
|
RemovePopTextUI();
|
|
@@ -378,6 +378,7 @@ namespace ComPDFKit.Tool
|
|
|
MouseLeftButtonDownHandler?.Invoke(this, mouseEventObject);
|
|
|
return;
|
|
|
}
|
|
|
+ AnnotData beforeSelectAnnotData = GetSelectAnnotData();
|
|
|
if (isDrawSelectRect)
|
|
|
{
|
|
|
if (e.ClickCount == 2)
|
|
@@ -457,8 +458,39 @@ namespace ComPDFKit.Tool
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
- SelectedAnnot();
|
|
|
- CleanDrawSelectImage();
|
|
|
+ if (AllowMultiSelect &&
|
|
|
+ (Keyboard.IsKeyDown(Key.LeftCtrl) || Keyboard.IsKeyDown(Key.RightCtrl)))
|
|
|
+ {
|
|
|
+ if (!AnnotSelectAreaHitTest())
|
|
|
+ {
|
|
|
+ if (AnnotMoveHitTest())
|
|
|
+ {
|
|
|
+ BaseAnnot hitAnnot = PDFViewer?.AnnotHitTest() as BaseAnnot;
|
|
|
+
|
|
|
+
|
|
|
+ if (beforeSelectAnnotData != null)
|
|
|
+ {
|
|
|
+ AnnotSelectAddItem(beforeSelectAnnotData);
|
|
|
+ }
|
|
|
+ if (AnnotSelectGetCount() == 0 && hitAnnot != null)
|
|
|
+ {
|
|
|
+ AnnotSelectAddItem(hitAnnot.GetAnnotData());
|
|
|
+ }
|
|
|
+
|
|
|
+ mouseEventObject.hitTestType = MouseHitTestType.Annot;
|
|
|
+ mouseEventObject.annotType = cacheHitTestAnnot.GetAnnotData().AnnotType;
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ AnnotSelectAreaHit();
|
|
|
+ }
|
|
|
+ }
|
|
|
+ AnnotSelectMoveHit();
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ SelectedAnnot();
|
|
|
+ }
|
|
|
}
|
|
|
isDrawSelectRect = true;
|
|
|
}
|
|
@@ -489,6 +521,10 @@ namespace ComPDFKit.Tool
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
+ if (!AnnotSelectAreaHitTest())
|
|
|
+ {
|
|
|
+ AnnotSelectAreaHit();
|
|
|
+ }
|
|
|
ReDrawSelectImage();
|
|
|
}
|
|
|
}
|
|
@@ -626,6 +662,45 @@ namespace ComPDFKit.Tool
|
|
|
{
|
|
|
return;
|
|
|
}
|
|
|
+ if (currentModel == ToolType.Pan || currentModel == ToolType.CreateAnnot)
|
|
|
+ {
|
|
|
+ bool areaSelectAdd = AnnotSelectAreaSelect(false, true);
|
|
|
+ if (AnnotMoveHitTest())
|
|
|
+ {
|
|
|
+ BaseAnnot checkItem = PDFViewer?.AnnotHitTest();
|
|
|
+ AnnotSelectAddItem(checkItem?.GetAnnotData(), !AnnotSelectAreaHitTest());
|
|
|
+ }
|
|
|
+ if (AnnotSelectGetCount() > 0)
|
|
|
+ {
|
|
|
+ CleanSelectedRect();
|
|
|
+ }
|
|
|
+ if (IsMoved == false && AnnotSelectAreaHitTest() == false && AnnotMoveHitTest() == false)
|
|
|
+ {
|
|
|
+ AnnotSelectClean();
|
|
|
+ }
|
|
|
+ if (AnnotSelectGetCount() == 1)
|
|
|
+ {
|
|
|
+ cacheHitTestAnnot = AnnotSelectGetAnnot();
|
|
|
+ if (cacheHitTestAnnot != null)
|
|
|
+ {
|
|
|
+ BaseLayer baseLayer = PDFViewer.GetViewForTag(selectedRectViewTag);
|
|
|
+ SelectedRect selectedRect = CommonHelper.FindVisualChild<SelectedRect>(baseLayer as CustomizeLayer);
|
|
|
+ if (selectedRect != null)
|
|
|
+ {
|
|
|
+ if (IsMoved && areaSelectAdd == false)
|
|
|
+ {
|
|
|
+ selectedRect.UpdateAnnotData(cacheHitTestAnnot.GetAnnotData());
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ selectedRect.SetAnnotData(cacheHitTestAnnot.GetAnnotData());
|
|
|
+ }
|
|
|
+ selectedRect.Draw();
|
|
|
+ }
|
|
|
+ isDrawSelectRect = true;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
|
|
|
if (currentModel == ToolType.WidgetEdit)
|
|
|
{
|
|
@@ -689,7 +764,7 @@ namespace ComPDFKit.Tool
|
|
|
}
|
|
|
MouseLeftButtonUpHandler?.Invoke(this, mouseEventObject);
|
|
|
ReleaseMouseCapture();
|
|
|
- if (currentModel == ToolType.WidgetEdit)
|
|
|
+ if (currentModel == ToolType.WidgetEdit || currentModel == ToolType.Pan || currentModel == ToolType.CreateAnnot)
|
|
|
{
|
|
|
AnnotSelectUpdate();
|
|
|
AnnotSelectDraw();
|
|
@@ -708,7 +783,7 @@ namespace ComPDFKit.Tool
|
|
|
return;
|
|
|
}
|
|
|
|
|
|
- if(FillManager?.MouseMoveHandle(e)==true)
|
|
|
+ if (FillManager?.MouseMoveHandle(e) == true)
|
|
|
{
|
|
|
return;
|
|
|
}
|
|
@@ -832,6 +907,15 @@ namespace ComPDFKit.Tool
|
|
|
AnnotSelectAreaHover();
|
|
|
}
|
|
|
}
|
|
|
+ if (currentModel == ToolType.Pan && !IsText() && IsSelectText())
|
|
|
+ {
|
|
|
+
|
|
|
+ AnnotSelectAreaDraw();
|
|
|
+ if (!AnnotSelectMoveDraw())
|
|
|
+ {
|
|
|
+ AnnotSelectAreaHover();
|
|
|
+ }
|
|
|
+ }
|
|
|
|
|
|
MouseMoveHandler?.Invoke(this, mouseEventObject);
|
|
|
PDFViewer.SetCustomMousePoint(Mouse.GetPosition(this).Y, Mouse.GetPosition(this).X);
|