Browse Source

文本注释-透明度调整

OYXH\oyxh 1 year ago
parent
commit
c5227d3442

+ 2 - 2
PDF Office/ViewModels/BOTA/AnnotationContentViewModel.cs

@@ -1213,7 +1213,7 @@ namespace PDF_Master.ViewModels.BOTA
             events.GetEvent<RefreshAnnotationEvent>().Publish(new RefreshAnnotationArgs() { Unicode = App.mainWindowViewModel.SelectedItem.Unicode, IsAll = false, annotHandlerArgs = args });
         }
 
-        public async void UpdateModifiedAnnot(int pageIndex, int annotIndex/*, bool isDelete*/)
+        public void UpdateModifiedAnnot(int pageIndex, int annotIndex/*, bool isDelete*/)
         {
             try
             {
@@ -1275,7 +1275,7 @@ namespace PDF_Master.ViewModels.BOTA
                                 }
                             }
 
-                            await Task.Delay(5);//不加延时 每页的第一个注释不会展开
+                            //await Task.Delay(5);//不加延时 每页的第一个注释不会展开
                             //if (ViewContentViewModel.IsMultiSelected == false)
                             //{
                             //    if (listBox.SelectedItems.IndexOf(AnnotationListItems[k]) == -1)

+ 14 - 2
PDF Office/ViewModels/PropertyPanel/AnnotPanel/FreetextAnnotPropertyViewModel.cs

@@ -383,9 +383,21 @@ namespace PDF_Master.ViewModels.PropertyPanel.AnnotPanel
         {
             if (obj != null && obj is double)
             {
-                BasicVm.FillOpacity = (double)obj;
-                BasicVm.FillColor.Opacity = BasicVm.FillOpacity;
+                if(BasicVm.FillOpacity!= (double)obj)
+                {
+                    BasicVm.FillOpacity = (double)obj;
+                  
+                }
+                if(BasicVm.FontColor.Opacity != BasicVm.FillOpacity)
+                {
+                    BasicVm.FontColor.Opacity = BasicVm.FillOpacity;
+                }
+                    
+                  
+                
+
                 PropertyPanel.UpdateAnnotAAttrib(AnnotAttrib.Transparency, BasicVm.FillOpacity);
+                PropertyPanel.InvokeToMyTools(AnnotArgsType.AnnotFreeText, BasicVm.FillOpacity);
             }
         }
 

+ 11 - 1
PDF Office/ViewModels/Tools/AnnotToolContentViewModel.Command.cs

@@ -1921,7 +1921,7 @@ namespace PDF_Master.ViewModels.Tools
                         case AnnotArgsType.AnnotSquare:
                         case AnnotArgsType.AnnotCircle:
                         case AnnotArgsType.AnnotLine:
-                        case AnnotArgsType.AnnotFreeText:
+                        
                             //创建注释后,修改注释属性,可用于下次创建的注释
                             if (PropertyPanel != null && PropertyPanel.annot != null && PDFViewer.MouseMode == MouseModes.AnnotCreate)
                             {
@@ -1933,6 +1933,16 @@ namespace PDF_Master.ViewModels.Tools
                                 }
                             }
 
+                            break;
+                        case AnnotArgsType.AnnotFreeText:
+                            
+                            if (PropertyPanel != null && PropertyPanel.annot != null && PDFViewer.MouseMode == MouseModes.AnnotCreate)
+                            {
+                                if (StrAnnotToolChecked == key.Key)
+                                {
+                                    PDFViewer.SetToolParam(PropertyPanel.annot);
+                                }
+                            }
                             break;
                     }
                 }