Browse Source

【注释】修复“文本注释修改填充颜色透明度变化”

wanjun 11 months ago
parent
commit
8088b8ab51

+ 2 - 46
PDF Office/PDF Master/Class/PDFWindowController/Side/RightSide/AnnotationProperty/KMGeneralAnnotationViewController.swift

@@ -1593,10 +1593,8 @@ let KMColorPickerViewHeight: CGFloat = 64
         
         if annotationType == .freeText {
             if let fillColorPickerColor = fillColorPickerView.color {
-                fillColorPickerColor.usingColorSpaceName(.calibratedRGB)?.getRed(&red, green: &green, blue: &blue, alpha: &opacity)
-                let color = NSColor(calibratedRed: red, green: green, blue: blue, alpha: opacity)
-                annotationModel?.setColor(color)
-                annotationModel?.setOpacity(opacity)
+                annotationModel?.setColor(fillColorPickerColor)
+//                annotationModel?.setOpacity(opacity)
             }
         } else {
             annotationModel?.setColor(fillColor)
@@ -1606,48 +1604,6 @@ let KMColorPickerViewHeight: CGFloat = 64
     }
     
     @IBAction func fontViewCorloPVAction(_ sender: Any) {
-//        var fillColor: NSColor = NSColor.clear
-//        var red: CGFloat = 0.0, green: CGFloat = 0.0, blue: CGFloat = 0.0, opacity: CGFloat = 0.0
-//        
-//        if let textColor = fontViewCorloPV.color {
-//            textColor.usingColorSpaceName(.calibratedRGB)?.getRed(&red, green: &green, blue: &blue, alpha: &opacity)
-//            if fabs(opacity - 0) < 0.001 {
-//                if annotationType == .freeText || annotationType == .signText || annotationType == .signDate {
-//                    annotationModel?.setOpacity(0)
-//                    annotationModel?.setFontColor(.black)
-//                } else {
-//                    annotationModel?.setOpacity(0)
-//                    annotationModel?.setFontColor(.black)
-//                }
-//            } else {
-//                if annotationType == .freeText || annotationType == .signText || annotationType == .signDate {
-//                    annotationModel?.setOpacity(opacity)
-//                    annotationModel?.setFontColor(textColor)
-//                } else {
-//                    annotationModel?.setOpacity(opacity)
-//                    annotationModel?.setColor(textColor)
-//                }
-//            }
-//            
-//            opacitySlider.floatValue = Float(opacity)
-//            
-//            if annotationModel?.annotation != nil {
-//                if annotationModel?.annotation is CPDFFreeTextAnnotation {
-//                    let textNote = (annotationModel?.annotation as! CPDFFreeTextAnnotation)
-//                    if let isEdit = pdfView?.isEdit(withCurrentFreeText: textNote), isEdit {
-//                        pdfView?.setEditAnnotationFreeTextColor(textColor, freeText: textNote)
-//                    } else {
-//                        updateAnnotation()
-//                    }
-//                } else {
-//                    updateAnnotation()
-//                }
-//                generalImageView.image = annotationModel?.annotationImage
-//            } else {
-//                updateAnnotation()
-//            }
-//        }
-        
         var red: CGFloat = 0.0, green: CGFloat = 0.0, blue: CGFloat = 0.0, opacity: CGFloat = 0.0
         if let fontViewPickerColor = fontViewCorloPV.color {
             fontViewPickerColor.usingColorSpaceName(.calibratedRGB)?.getRed(&red, green: &green, blue: &blue, alpha: &opacity)