ソースを参照

【注释】修复“添加注释后,属性面板编辑笔记,编辑后退出重进,编辑无效”(22200)

wanjun 11 ヶ月 前
コミット
f1ac6e1cfc

+ 5 - 29
PDF Office/PDF Master/Class/PDFWindowController/Side/RightSide/AnnotationProperty/KMGeneralAnnotationViewController.swift

@@ -2316,34 +2316,6 @@ let KMColorPickerViewHeight: CGFloat = 64
     // MARK: NSNotification
     
     @objc func textDidChange(_ notification: Notification) {
-//        self.isTextEdit = true
-//        
-//        if self.subType == KMSelfSignAnnotationFreeTextSubType.freeText && isannotationMode {
-//            if let obj = notification.object as? NSObject {
-//                for tAnnotation in annotations {
-//                    tAnnotation.setString(noteTextView.string)
-//                }
-//                
-//                if obj.isEqual(to: noteTextView) {
-//                    UserDefaults.standard.set(noteTextView.string, forKey: SKAnnotationSelfSignPlaceHolderStringKey)
-//                }
-//                
-//                if annotation.isKind(of: CPDFFreeTextAnnotation.self) {
-//                    textAnnotationImageView.image = annotationModel?.annotationImage
-//                } else {
-//                    generalImageView.image = annotationModel?.annotationImage
-//                }
-//            }
-//        } else {
-//            if let obj = notification.object as? NSObject, obj.isEqual(to: noteTextView) {
-//                for tAnnotation in self.annotations {
-//                    tAnnotation.setString(noteTextView.string)
-//                }
-//            }
-//        }
-    }
-    
-    @objc func textDidEndEditing(_ notification: Notification) {
         self.isTextEdit = true
         
         if self.subType == KMSelfSignAnnotationFreeTextSubType.freeText && isannotationMode {
@@ -2365,7 +2337,11 @@ let KMColorPickerViewHeight: CGFloat = 64
         } else {
             if let obj = notification.object as? NSObject, obj.isEqual(to: noteTextView) {
                 for tAnnotation in self.annotations {
-                    tAnnotation.setString(noteTextView.string)
+                    if let markupNote = tAnnotation as? CPDFMarkupAnnotation {
+                        markupNote.setMarkupText(noteTextView.string)
+                    } else {
+                        tAnnotation.setString(noteTextView.string)
+                    }
                 }
             }
         }