Переглянути джерело

【属性面板】- 多选形状注释属性面板显示修改

liaoxiaoyue 1 рік тому
батько
коміт
5414a870f9

+ 10 - 3
PDF Office/PDF Office/Class/PDFWindowController/Side/RightSide/AnnotationProperty/KMGeneralAnnotationViewController.m

@@ -719,7 +719,9 @@
 //边框颜色
 - (void)updateBorderOpacityView {
     CGFloat opacity = self.annotationModel.opacity;
-
+    if(self.annotationModel.annotations.count > 1) {
+        opacity = self.annotationModel.annotation.opacity;
+    }
     self.borderOpacitySlider.floatValue = opacity;
     self.borderOpacitySlider.toolTip = [NSString stringWithFormat:@"%@%%",@((int)(opacity*100))];
     self.borderOpacityComboBox.stringValue = [NSString stringWithFormat:@"%@%%",@((int)(opacity*100))];
@@ -730,6 +732,11 @@
 - (void)updateBorderWidthView
 {
     CGFloat lineWidth = self.annotationModel.lineWidth;
+    CPDFBorderStyle stype = self.annotationModel.style;
+    if(self.annotationModel.annotations.count > 1) {
+        lineWidth = self.annotationModel.annotation.borderWidth;
+        stype = self.annotationModel.annotation.border.style;
+    }
     self.borderWidthSlider.floatValue = lineWidth;
     self.borderWidthSlider.toolTip = [NSString stringWithFormat:@"%0.1f pt",lineWidth];
     self.borderWidthComboBox.stringValue = [NSString stringWithFormat:@"%0.1f pt",lineWidth];
@@ -737,7 +744,7 @@
     self.generalImageView.image = [self.annotationModel annotationImage];
     
     if (self.annotationModel.annotationType == CAnnotationTypeEraser)  return;
-    if (self.annotationModel.style == CPDFBorderStyleDashed) {
+    if (stype == CPDFBorderStyleDashed) {
         self.borderWidthStyleDotted.wantsLayer = YES;
         self.borderWidthStyleDotted.layer.backgroundColor = [NSColor colorWithRed:206.0/255.0 green:208.0/255.0 blue:212.0/255.0 alpha:0.6].CGColor;
         self.borderWidthStyleDotted.layer.borderWidth = 1.0;
@@ -748,7 +755,7 @@
         self.borderWidthStyleReal.layer.borderWidth = 0;
         self.borderWidthStyleReal.layer.cornerRadius = 0;
         self.borderWidthStyleReal.layer.borderColor = [NSColor clearColor].CGColor;
-    } else if (self.annotationModel.style == CPDFBorderStyleSolid) {
+    } else if (stype == CPDFBorderStyleSolid) {
         self.borderWidthStyleReal.wantsLayer = YES;
         self.borderWidthStyleReal.layer.backgroundColor = [NSColor colorWithRed:206.0/255.0 green:208.0/255.0 blue:212.0/255.0 alpha:0.6].CGColor;
         self.borderWidthStyleReal.layer.borderWidth = 1.0;