فهرست منبع

【fix】【标记密文】标记密文后的显示/隐藏内容状态 和 Adobe正好相反,是否需要调整

tangchao 5 ماه پیش
والد
کامیت
f08fe8b255

+ 5 - 2
PDF Office/PDF Master/Class/PDFTools/Redact/View/KMRedactPDFView.swift

@@ -227,10 +227,10 @@ private let KMPDFViewRedactAnnotationAcross = "KMPDFViewRedactAnnotationAcross"
         }
         let newActiveAnnotation = page?.annotation(at: pagePoint)
         if newActiveAnnotation != nil && newActiveAnnotation is CPDFRedactAnnotation && self.mouseMoveAnnotation == newActiveAnnotation {
-            (newActiveAnnotation as? CPDFRedactAnnotation)?.drawRedactionsAsRedacted = true
+            (newActiveAnnotation as? CPDFRedactAnnotation)?.drawRedactionsAsRedacted = false
             self.setNeedsDisplayAnnotationViewFor(page)
         } else if self.mouseMoveAnnotation != nil && self.mouseMoveAnnotation is CPDFRedactAnnotation {
-            (self.mouseMoveAnnotation as? CPDFRedactAnnotation)?.drawRedactionsAsRedacted = false
+            (self.mouseMoveAnnotation as? CPDFRedactAnnotation)?.drawRedactionsAsRedacted = true
             self.setNeedsDisplayAnnotationViewFor(page)
         }
         self.mouseMoveAnnotation = newActiveAnnotation
@@ -323,6 +323,7 @@ private let KMPDFViewRedactAnnotationAcross = "KMPDFViewRedactAnnotationAcross"
                         annotation?.setFont(font)
                         annotation?.setOverlayText(KMPDFAnnotationRedactConfig.shared.overlayTextString)
                     }
+                    annotation?.drawRedactionsAsRedacted = true
                     self.addAnnotation(with: annotation, to: page)
                     self.newAddAnnotation.append(annotation!)
                     self.setNeedsDisplayFor(page)
@@ -406,6 +407,8 @@ private let KMPDFViewRedactAnnotationAcross = "KMPDFViewRedactAnnotationAcross"
                     annotation?.setFont(font)
                     annotation?.setOverlayText(KMPDFAnnotationRedactConfig.shared.overlayTextString)
                 }
+                
+                annotation?.drawRedactionsAsRedacted = true
                 self.addAnnotation(with: annotation, to: page)
                 self.newAddAnnotation.append(annotation!)
                 break

+ 22 - 22
PDF Office/PDF Master/Class/PDFWindowController/Side/LeftSide/KMLeftSideViewController+Note.swift

@@ -215,28 +215,28 @@ extension KMLeftSideViewController {
 //            }
 //        }
         if hideNotes == false && (items?.count ?? 0) == 1 {
-            let annotation = self.noteItems(items!).lastObject as? CPDFAnnotation
-            if let data = annotation?.isEditable(), data {
-                if annotation?.type == nil {
-                    let isNote = annotation?.isNote() ?? false
-                    if isNote {
-                        // [NSLocalizedString(@"Edit", @"Menu item title") stringByAppendingEllipsis]
-                        item = menu.addItem(title: KMLocalizedString("Edit", "Menu item title"), action: #selector(editNoteTextFromTable), target: self)
-                        item?.representedObject = annotation
-                    }
-                } else if let data = self.noteOutlineView.tableColumn(withIdentifier: NSUserInterfaceItemIdentifier("note"))?.isHidden, data  {
-                    //                            [NSLocalizedString(@"Edit", @"Menu item title") stringByAppendingEllipsis]
-                    item = menu.addItem(title: KMLocalizedString("Edit", "Menu item title"), action: #selector(editThisAnnotation), target: self)
-                    item?.representedObject = annotation
-                } else {
-                    item = menu.addItem(title: KMLocalizedString("Edit", "Menu item title"), action: #selector(editNoteFromTable), target: self)
-                    item?.representedObject = annotation
-                    item = menu.addItem(title: KMLocalizedString("Edit", "Menu item title"), action: #selector(editThisAnnotation), target: self)
-                    item?.representedObject = annotation
-                    item?.keyEquivalentModifierMask = [.option]
-                    item?.isAlternate = true
-                }
-            }
+//            let annotation = self.noteItems(items!).lastObject as? CPDFAnnotation
+//            if let data = annotation?.isEditable(), data {
+//                if annotation?.type == nil {
+//                    let isNote = annotation?.isNote() ?? false
+//                    if isNote {
+//                        // [NSLocalizedString(@"Edit", @"Menu item title") stringByAppendingEllipsis]
+//                        item = menu.addItem(title: KMLocalizedString("Edit", "Menu item title"), action: #selector(editNoteTextFromTable), target: self)
+//                        item?.representedObject = annotation
+//                    }
+//                } else if let data = self.noteOutlineView.tableColumn(withIdentifier: NSUserInterfaceItemIdentifier("note"))?.isHidden, data  {
+//                    //                            [NSLocalizedString(@"Edit", @"Menu item title") stringByAppendingEllipsis]
+//                    item = menu.addItem(title: KMLocalizedString("Edit", "Menu item title"), action: #selector(editThisAnnotation), target: self)
+//                    item?.representedObject = annotation
+//                } else {
+//                    item = menu.addItem(title: KMLocalizedString("Edit", "Menu item title"), action: #selector(editNoteFromTable), target: self)
+//                    item?.representedObject = annotation
+//                    item = menu.addItem(title: KMLocalizedString("Edit", "Menu item title"), action: #selector(editThisAnnotation), target: self)
+//                    item?.representedObject = annotation
+//                    item?.keyEquivalentModifierMask = [.option]
+//                    item?.isAlternate = true
+//                }
+//            }
         }
         
         if menu.numberOfItems > 0 {