Selaa lähdekoodia

【2025】【PDFView】 pop框Fill注释 圆点注释不显示线条宽度

dinglingui 2 kuukautta sitten
vanhempi
commit
246aff7348

+ 25 - 2
PDF Office/PDF Master/KMClass/PDFListView/WindowController/KMNPopAnnotationWindowController.swift

@@ -48,9 +48,31 @@ class KMNPopAnnotationWindowController: KMNBaseWindowController {
                 operationBox.contentView = fontPopView
                 break
             case .shapeAnnotation:
+                var isContainSelfDot = false
+                for i in 0..<annotationPopMode.annotations.count {
+                    if let selfAn = annotationPopMode.annotations[i] as? CSelfSignAnnotation {
+                        if selfAn.annotationType == .signDot {
+                            isContainSelfDot = true
+                            break
+                        }
+                    }
+                }
+                
+                var width = 272.0
+                if isContainSelfDot == true {
+                    shapeRightConstraint.constant = 0
+                    widthZoomOutButton.isHidden = true
+                    widthZoomInButton.isHidden = true
+                    width = 200.0
+                } else {
+                    shapeRightConstraint.constant = 72
+                    widthZoomOutButton.isHidden = false
+                    widthZoomInButton.isHidden = false
+                }
                 shapeView.layoutSubtreeIfNeeded()
 
-                operationWidthConstraint.constant = shapeView.bounds.width
+//                operationWidthConstraint.constant = shapeView.bounds.width //刷新后未更新最后的宽度,暂时写死宽度
+                operationWidthConstraint.constant = width
                 self.window?.display() //需刷新约束才会有值,不然会变化
                 operationBox.contentView = shapeView
                 break
@@ -391,7 +413,8 @@ class KMNPopAnnotationWindowController: KMNBaseWindowController {
     @IBOutlet var shapeColorGroup: ComponentCColorGroup!
     @IBOutlet var widthZoomOutButton: ComponentButton!
     @IBOutlet var widthZoomInButton: ComponentButton!
-    
+    @IBOutlet weak var shapeRightConstraint: NSLayoutConstraint!
+
     @IBOutlet var linkView: NSView!
     @IBOutlet var pageLinkButton: ComponentButton!
     @IBOutlet var urlLinkButton: ComponentButton!