Browse Source

【2025】【PDFView】pop框去除相同颜色逻辑处理

dinglingui 1 month ago
parent
commit
0766db9b25

+ 7 - 19
PDF Office/PDF Master/KMClass/PDFListView/WindowController/KMNPopAnnotationWindowController.swift

@@ -133,33 +133,21 @@ class KMNPopAnnotationWindowController: KMNBaseWindowController {
             popType = annotationPopType
             if annotationPopType == .generaAnnotation {
                 let newColor = annotationPopMode.annotationColor()
-                let oldColor = annotationColor
-                if !CPDFListView.isTheSameColor(newColor, anotherColor: oldColor) {
-                    annotationColor = newColor
-                }
+                annotationColor = newColor
+
             } else if(annotationPopType == .shapeAnnotation) {
                 let newColor = annotationPopMode.annotationColor()
-                let oldColor = annotationColor
-                if !CPDFListView.isTheSameColor(newColor, anotherColor: oldColor) {
-                    annotationColor = newColor
-                }
+                annotationColor = newColor
             } else if(annotationPopType == .freeTextAnnotation) {
                 let newColor = annotationPopMode.annotationFontColor()
-                
-                let oldColor = fontColor
-                if !CPDFListView.isTheSameColor(newColor, anotherColor: oldColor) {
-                    fontColor = newColor
-                }
+                fontColor = newColor
+
                 
                 let alignment = annotationPopMode.annotationAlignment()
-                if(alignment != self.fontAlight) {
-                    fontAlight = alignment
-                }
+                fontAlight = alignment
                 
                 let font = annotationPopMode.annotationFontName()
-                if(font?.familyName != compdfFont?.familyName || font?.styleName != compdfFont?.styleName) {
-                    compdfFont = font
-                }
+                compdfFont = font
             } else if annotationPopType == .linkAnnotation {
                 if annotationPopMode.annotation != nil {
                     linkAnnotation = annotationPopMode.annotation as! CPDFLinkAnnotation