Ver código fonte

【注释】修复属性面板获取注释已有string信息加载在“note”控件上

wanjun 1 ano atrás
pai
commit
bcfa3351ed

+ 7 - 4
PDF Office/PDF Master/Class/PDFWindowController/Side/RightSide/AnnotationProperty/KMGeneralAnnotationViewController.swift

@@ -465,14 +465,17 @@ let KMColorPickerViewHeight: CGFloat = 64
             opacity = (annotationModel?.opacity())!
         }
 
-        let contextString = annotationModel?.stringValue() ?? ""
         
         opacitySlider.floatValue = Float(opacity)
         opacitySlider.toolTip = "\(Int(opacity * 100))%"
         opacityComboBox.stringValue = "\(Int(opacity * 100))%"
-        noteTextView.string = contextString
-        noteTextView.textColor = NSColor.labelColor
-        noteTextView.delegate = self
+        
+        if annotationModel?.annotations != nil {
+            let contextString = annotation.string() ?? ""
+            noteTextView.string = contextString
+            noteTextView.textColor = NSColor.labelColor
+            noteTextView.delegate = self
+        }
         
         if annotationType == .freeText {
             imageBox.contentView = textImageBoxView