Browse Source

填写签名-联动BUG

liyijie 1 year ago
parent
commit
63839838f7

+ 21 - 7
PDF Office/ViewModels/FillAndSign/FillAndSignContentViewModel.cs

@@ -1594,7 +1594,7 @@ namespace PDF_Master.ViewModels.FillAndSign
 
                             break;
                         case ActionType.Del:
-                            
+
 
                             break;
                     }
@@ -1607,24 +1607,27 @@ namespace PDF_Master.ViewModels.FillAndSign
             }
 
         }
-
+        int a = 0;
         //选中和非选中注释,右键菜单
         private void PDFViewer_AnnotActiveHandler(object sender, AnnotAttribEvent e)
         {
             if (e != null)
             {
+                
                 IsClickNull = false;
                 var annot = e.AnnotItemsList[0];
                 if (annot != null)
                 {
-
+                    
                     if (e.AnnotItemsList.Count == 1)
                     {
+                       
                         //IsEdit = false;
                         //IsAnnotCreateReset:是否为创建注释的状态
                         if (e.IsAnnotCreateReset == false)
                         {
-
+                            a++;
+                            Trace.WriteLine("选中" + a);
                             GetSelectedAnnots(e);
 
                             //记录这次选中的注释,之后创建注释会跟随上次选中注释的属性值
@@ -1632,6 +1635,8 @@ namespace PDF_Master.ViewModels.FillAndSign
                         }
                         else
                         {
+                            a++;
+                            Trace.WriteLine("创建"+a);
                             //TODO: 设计已重新调整为(仅限高亮注释):修改注释后,会作用到之后添加的注释中。因此先把此逻辑“创建注释后,会自动回到默认值”注释掉
                             if (annot.EventType != AnnotArgsType.AnnotStrikeout &&
                                 annot.EventType != AnnotArgsType.AnnotUnderline &&
@@ -1701,9 +1706,17 @@ namespace PDF_Master.ViewModels.FillAndSign
             }
             else
             {
-                if (PDFViewer.MouseMode != MouseModes.AnnotCreate) { viewContentViewModel.SelectedPrpoertyPanel("PropertyPanelContent", null); }
-
-                else { IsClickNull = true; }
+                if (PDFViewer.MouseMode != MouseModes.AnnotCreate)
+                {
+                    Trace.WriteLine("点击空白2" + a);
+                    viewContentViewModel.SelectedPrpoertyPanel("PropertyPanelContent", null);
+                  
+                }
+              
+                else { IsClickNull = true; Trace.WriteLine("点击空白1" + a); }
+                a++;
+              
+                a = 0;
             }
         }
 
@@ -1856,6 +1869,7 @@ namespace PDF_Master.ViewModels.FillAndSign
             HookShapeIsCheck = true;
             HookShapeIsCheck = false;
             ShowPropertyPanel(false);
+            PDFViewer.SetMouseMode(MouseModes.PanTool);
             // InitCheckedEvent("RbtnTick");
             IsEdit = false;
 

+ 20 - 8
PDF Office/ViewModels/FillAndSign/PropertyPanel/ShapFillPropertyViewModel.cs

@@ -40,6 +40,7 @@ namespace PDF_Master.ViewModels.FillAndSign.PropertyPanel
         public List<List<Point>> updatapath = new List<List<Point>>();
         private Geometry dataPath = null;
         private bool IsFillAndSign = false;
+        private bool IsUpDataCreate = false;
         public string shape = "";
         public string Shape
         {
@@ -50,7 +51,14 @@ namespace PDF_Master.ViewModels.FillAndSign.PropertyPanel
             }
         }
 
-
+        public bool _isCreate = false;
+        public bool IsCreate
+        {
+            get {
+                if (fillAndSignContentViewModel != null) { if (fillAndSignContentViewModel.PDFViewer.MouseMode != MouseModes.AnnotCreate) { return false; } else { return true; } }
+            else { return false; }
+            }
+        }
         public string shapeType = "";
         public string ShapeType
         {
@@ -574,7 +582,7 @@ namespace PDF_Master.ViewModels.FillAndSign.PropertyPanel
 
             if (!fillAndSignContentViewModel.isFirst)
             {
-                fillAndSignContentViewModel.LineWidth = LineWidth;
+                
 
                 //if (FillAndSignContentViewModel.IsEdit)
                 {
@@ -584,7 +592,7 @@ namespace PDF_Master.ViewModels.FillAndSign.PropertyPanel
                 }
                 // else
                 {
-                    if (IsFillAndSign) { fillAndSignContentViewModel.SetStamp(); }
+                    if (IsFillAndSign&&IsUpDataCreate && IsCreate) { fillAndSignContentViewModel.LineWidth = LineWidth; fillAndSignContentViewModel.SetStamp(); }
 
                 }
 
@@ -601,7 +609,7 @@ namespace PDF_Master.ViewModels.FillAndSign.PropertyPanel
                 if (newColor.A != oldColor.A || newColor.B != oldColor.B || newColor.R != oldColor.R || newColor.G != oldColor.G)
                 {
                     ShapeColorColor = SelectColor;
-                    fillAndSignContentViewModel.SelectColor = SelectColor;
+                   
                     //if (FillAndSignContentViewModel.IsEdit)
                     {
                         // PropertyPanel.UpdateAnnotAAttrib(AnnotAttrib.Thickness, LineWidth * lineWidthMultiple);
@@ -610,7 +618,10 @@ namespace PDF_Master.ViewModels.FillAndSign.PropertyPanel
                     }
                     //else
                     {
-                        if (IsFillAndSign) { fillAndSignContentViewModel.SetStamp(); }
+                        if (IsFillAndSign&&IsUpDataCreate&&IsCreate) {
+                            fillAndSignContentViewModel.SelectColor = SelectColor;
+                            fillAndSignContentViewModel.SetStamp();
+                        }
 
                     }
                 }
@@ -620,7 +631,7 @@ namespace PDF_Master.ViewModels.FillAndSign.PropertyPanel
         {
             if (!fillAndSignContentViewModel.isFirst)
             {
-                fillAndSignContentViewModel.FillOpacity = FillOpacity;
+               
 
                 //if (FillAndSignContentViewModel.IsEdit)
                 {
@@ -630,7 +641,7 @@ namespace PDF_Master.ViewModels.FillAndSign.PropertyPanel
 
                 //else
                 {
-                    if (IsFillAndSign) { fillAndSignContentViewModel.SetStamp(); }
+                    if (IsFillAndSign&&IsUpDataCreate&&IsCreate) { fillAndSignContentViewModel.FillOpacity = FillOpacity; fillAndSignContentViewModel.SetStamp(); }
 
                 }
 
@@ -912,8 +923,9 @@ namespace PDF_Master.ViewModels.FillAndSign.PropertyPanel
                                     ForkIsChecked = true;
 
                                 }
+                                IsUpDataCreate = false;
                                 SelectColor = new SolidColorBrush(annot.InkColor);
-
+                                IsUpDataCreate=true;
 
                                 FillOpacity = annot.Transparency;
                                 InitShapesType(point.Shape);