|
@@ -426,22 +426,44 @@ namespace PDF_Master.ViewModels.Tools
|
|
|
{
|
|
|
viewContentViewModel.SelectedPrpoertyPanel("PropertyPanelContent", null);
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
//PDFViewer.SetMouseMode(MouseModes.PanTool);
|
|
|
//HandToolIsCheckedEvent(false);
|
|
|
return;
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
- if (StrAnnotToolChecked != "Stamp" && StrAnnotToolChecked != "Freetext")
|
|
|
+ if (StrAnnotToolChecked == "Rect" && PropertyPanel.IsSelectedTextAddShape == false)
|
|
|
{
|
|
|
AnnotHandlerEventArgs annotArgs = null;
|
|
|
//此处不能用这个方法更新创建注释的属性 会导致死循环
|
|
|
+ //选择文字 点击矩形 会导致死循环
|
|
|
// FindAnnotTypeKey(StrAnnotToolChecked, ref annotArgs);
|
|
|
|
|
|
+ PropertyPanel.annot = null;
|
|
|
+ PropertyPanel.AnnotEvents = null;
|
|
|
+ PropertyPanel.AnnotEvent = null;
|
|
|
+ PropertyPanel.annotlists = null;
|
|
|
+ switch (PropertyPanel.SharpsAnnot)
|
|
|
+ {
|
|
|
+ case "Rect":
|
|
|
+ annotArgs = GetRect();
|
|
|
+ break;
|
|
|
+
|
|
|
+ case "Circle":
|
|
|
+ annotArgs = GetCircle();
|
|
|
+ break;
|
|
|
+
|
|
|
+ case "Arrow":
|
|
|
+ annotArgs = GetArrowLine("Arrow");
|
|
|
+ break;
|
|
|
+
|
|
|
+ case "Line":
|
|
|
+ annotArgs = GetArrowLine("Line");
|
|
|
+ break;
|
|
|
+ }
|
|
|
return;
|
|
|
}
|
|
|
- return;
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -508,7 +530,7 @@ namespace PDF_Master.ViewModels.Tools
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
- if (!string.IsNullOrEmpty(StrAnnotToolChecked)|| PropertyPanel.IsAddLink==true)
|
|
|
+ if (!string.IsNullOrEmpty(StrAnnotToolChecked) || PropertyPanel.IsAddLink == true)
|
|
|
{
|
|
|
GetSelectedAnnots(e);
|
|
|
PDFViewer.SetToolParam(annot);
|
|
@@ -922,10 +944,9 @@ namespace PDF_Master.ViewModels.Tools
|
|
|
/// <param name="e"></param>
|
|
|
private void PDFViewer_SnapshotCommandHandler(object sender, SnapshotCommandArgs e)
|
|
|
{
|
|
|
- SnapshotEditToolArgs snapToolArgs=new SnapshotEditToolArgs ();
|
|
|
+ SnapshotEditToolArgs snapToolArgs = new SnapshotEditToolArgs();
|
|
|
if (PDFViewer.ToolManager.CurrentAnnotArgs is SnapshotEditToolArgs)
|
|
|
{
|
|
|
-
|
|
|
snapToolArgs = (SnapshotEditToolArgs)PDFViewer.ToolManager.CurrentAnnotArgs;
|
|
|
|
|
|
SnapshotEditMenuViewModel.SnapToolArgs = snapToolArgs;
|
|
@@ -1099,8 +1120,9 @@ namespace PDF_Master.ViewModels.Tools
|
|
|
else
|
|
|
{
|
|
|
if (annot.EventType == AnnotArgsType.AnnotSquare || annot.EventType == AnnotArgsType.AnnotCircle ||
|
|
|
- annot.EventType == AnnotArgsType.AnnotLine || annot.EventType == AnnotArgsType.AnnotStamp /*||
|
|
|
- annot.EventType == AnnotArgsType.AnnotSticky ||annot.EventType == AnnotArgsType.AnnotFreeText || annot.EventType == AnnotArgsType.AnnotFreehand*/)
|
|
|
+ annot.EventType == AnnotArgsType.AnnotLine || annot.EventType == AnnotArgsType.AnnotStamp ||
|
|
|
+ annot.EventType==AnnotArgsType.AnnotLink
|
|
|
+ /*|| annot.EventType == AnnotArgsType.AnnotSticky ||annot.EventType == AnnotArgsType.AnnotFreeText || annot.EventType == AnnotArgsType.AnnotFreehand*/)
|
|
|
{
|
|
|
if (selectAnnotDicts.ContainsKey(editEvent.PageIndex) == false)
|
|
|
{
|
|
@@ -1185,7 +1207,7 @@ namespace PDF_Master.ViewModels.Tools
|
|
|
int annotindex = editEvent.AnnotIndex;
|
|
|
viewModel.DeleteModifiedAnnot(pageindex, annotindex);
|
|
|
}
|
|
|
- if(string.IsNullOrEmpty(StrAnnotToolChecked))
|
|
|
+ if (string.IsNullOrEmpty(StrAnnotToolChecked))
|
|
|
{
|
|
|
ExitAnnotationTool();
|
|
|
viewContentViewModel.SelectedPrpoertyPanel("PropertyPanelContent", null);
|
|
@@ -1291,6 +1313,10 @@ namespace PDF_Master.ViewModels.Tools
|
|
|
return;
|
|
|
}
|
|
|
}
|
|
|
+ if (StrAnnotToolChecked == "Freehand")
|
|
|
+ {
|
|
|
+ return;
|
|
|
+ }
|
|
|
Rect hoverRect = new Rect(
|
|
|
e.PaintRect.Left - 2,
|
|
|
e.PaintRect.Top - 2,
|