|
@@ -352,7 +352,7 @@ namespace ComPDFKit.Tool
|
|
{
|
|
{
|
|
return;
|
|
return;
|
|
}
|
|
}
|
|
-
|
|
|
|
|
|
+
|
|
if (!HitTestBorder())
|
|
if (!HitTestBorder())
|
|
{
|
|
{
|
|
RemovePopTextUI();
|
|
RemovePopTextUI();
|
|
@@ -378,6 +378,7 @@ namespace ComPDFKit.Tool
|
|
MouseLeftButtonDownHandler?.Invoke(this, mouseEventObject);
|
|
MouseLeftButtonDownHandler?.Invoke(this, mouseEventObject);
|
|
return;
|
|
return;
|
|
}
|
|
}
|
|
|
|
+ AnnotData beforeSelectAnnotData = GetSelectAnnotData();
|
|
if (isDrawSelectRect)
|
|
if (isDrawSelectRect)
|
|
{
|
|
{
|
|
if (e.ClickCount == 2)
|
|
if (e.ClickCount == 2)
|
|
@@ -457,8 +458,39 @@ namespace ComPDFKit.Tool
|
|
}
|
|
}
|
|
else
|
|
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;
|
|
isDrawSelectRect = true;
|
|
}
|
|
}
|
|
@@ -489,6 +521,10 @@ namespace ComPDFKit.Tool
|
|
}
|
|
}
|
|
else
|
|
else
|
|
{
|
|
{
|
|
|
|
+ if (!AnnotSelectAreaHitTest())
|
|
|
|
+ {
|
|
|
|
+ AnnotSelectAreaHit();
|
|
|
|
+ }
|
|
ReDrawSelectImage();
|
|
ReDrawSelectImage();
|
|
}
|
|
}
|
|
}
|
|
}
|
|
@@ -626,6 +662,45 @@ namespace ComPDFKit.Tool
|
|
{
|
|
{
|
|
return;
|
|
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)
|
|
if (currentModel == ToolType.WidgetEdit)
|
|
{
|
|
{
|
|
@@ -689,7 +764,7 @@ namespace ComPDFKit.Tool
|
|
}
|
|
}
|
|
MouseLeftButtonUpHandler?.Invoke(this, mouseEventObject);
|
|
MouseLeftButtonUpHandler?.Invoke(this, mouseEventObject);
|
|
ReleaseMouseCapture();
|
|
ReleaseMouseCapture();
|
|
- if (currentModel == ToolType.WidgetEdit)
|
|
|
|
|
|
+ if (currentModel == ToolType.WidgetEdit || currentModel == ToolType.Pan || currentModel == ToolType.CreateAnnot)
|
|
{
|
|
{
|
|
AnnotSelectUpdate();
|
|
AnnotSelectUpdate();
|
|
AnnotSelectDraw();
|
|
AnnotSelectDraw();
|
|
@@ -708,7 +783,7 @@ namespace ComPDFKit.Tool
|
|
return;
|
|
return;
|
|
}
|
|
}
|
|
|
|
|
|
- if(FillManager?.MouseMoveHandle(e)==true)
|
|
|
|
|
|
+ if (FillManager?.MouseMoveHandle(e) == true)
|
|
{
|
|
{
|
|
return;
|
|
return;
|
|
}
|
|
}
|
|
@@ -832,6 +907,15 @@ namespace ComPDFKit.Tool
|
|
AnnotSelectAreaHover();
|
|
AnnotSelectAreaHover();
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
+ if (currentModel == ToolType.Pan && !IsText() && IsSelectText())
|
|
|
|
+ {
|
|
|
|
+
|
|
|
|
+ AnnotSelectAreaDraw();
|
|
|
|
+ if (!AnnotSelectMoveDraw())
|
|
|
|
+ {
|
|
|
|
+ AnnotSelectAreaHover();
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
|
|
MouseMoveHandler?.Invoke(this, mouseEventObject);
|
|
MouseMoveHandler?.Invoke(this, mouseEventObject);
|
|
PDFViewer.SetCustomMousePoint(Mouse.GetPosition(this).Y, Mouse.GetPosition(this).X);
|
|
PDFViewer.SetCustomMousePoint(Mouse.GetPosition(this).Y, Mouse.GetPosition(this).X);
|