Pārlūkot izejas kodu

【综合】合并代码

tangchao 4 mēneši atpakaļ
vecāks
revīzija
6dda8c408f

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

@@ -323,7 +323,7 @@ class KMPDFWhiteOutRedactAnnotation: CPDFRedactAnnotation {
                     annotation?.setUserName(userName)
                     
 //                    annotation?.borderWidth = 10
-                    annotation?.borderWidth = 2
+                    annotation?.borderWidth = 1
                     if self.isWhiteOut {
                         annotation?.setBorderColor(.red)
                         annotation?.setInteriorColor(.white)
@@ -414,7 +414,7 @@ class KMPDFWhiteOutRedactAnnotation: CPDFRedactAnnotation {
 
 //                if ([annotation isKindOfClass:[CPDFRedactAnnotation class]]) {
 //                annotation?.borderWidth = 10
-                annotation?.borderWidth = 2
+                annotation?.borderWidth = 1
                 if self.isWhiteOut {
                     annotation?.setBorderColor(.red)
                     annotation?.setInteriorColor(.white)

+ 5 - 2
PDF Office/PDF Master/Class/PDFWindowController/PDFListView/CPDFListViewExtension/CPDFListView+Event.m

@@ -352,8 +352,6 @@ static inline CPDFAreaOfInterest CAreaOfInterestForResizeHandle(CRectEdges mask,
     
     if(CRedactToolMode == self.toolMode && ![newActiveAnnotation isKindOfClass:[CPDFRedactAnnotation class]])
         newActiveAnnotation = nil;
-    else if(CRedactToolMode != self.toolMode && [newActiveAnnotation isKindOfClass:[CPDFRedactAnnotation class]])
-        newActiveAnnotation = nil;
     
     [CPDFListView cancelPreviousPerformRequestsWithTarget:self selector:@selector(showHUDHint:) object:self.hoverAnnotation];
     if ((CNoteToolMode == self.toolMode || CTextToolMode == self.toolMode || CRedactErasureToolMode == self.toolMode) &&
@@ -683,6 +681,11 @@ static inline CPDFAreaOfInterest CAreaOfInterestForResizeHandle(CRectEdges mask,
             
         }
     }
+    
+    if(CRedactToolMode != self.toolMode && [annotationSel isKindOfClass:[CPDFRedactAnnotation class]]) {
+        return nil;
+    }
+
     NSMenuItem * copyItem = [[NSMenuItem alloc] initWithTitle:NSLocalizedString(@"Copy", @"PDFListView") action:@selector(copy:) keyEquivalent:@"c"];
     
     NSMenuItem * pasteItem = [[NSMenuItem alloc] initWithTitle:NSLocalizedString(@"Paste", @"PDFListView") action:@selector(menuItemClick_Paste:) keyEquivalent:@"v"];

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

@@ -635,6 +635,9 @@ extension KMLeftSideViewController {
                 for model in self.annoListModel?.datas ?? [] {
                     for item in model.items {
                         if let anno = item.anno {
+                            if let data = anno as? CPDFFreeTextAnnotation {
+                                self.listView?.commitEditAnnotationFreeText(data)
+                            }
                             self.listView?.remove(anno)
                         }
                     }

+ 3 - 0
PDF Office/PDF Master/Class/PDFWindowController/Side/LeftSide/KMLeftSideViewController.swift

@@ -2874,6 +2874,9 @@ extension KMLeftSideViewController: KMCustomOutlineViewDelegate, KMCustomOutline
                 guard let anno = item as? CPDFAnnotation else {
                     continue
                 }
+                if let data = anno as? CPDFFreeTextAnnotation {
+                    self.listView?.commitEditAnnotationFreeText(data)
+                }
                 self.listView?.remove(anno)
             }
             for item in items {

+ 3 - 1
PDF Office/PDF Master/Class/PDFWindowController/Side/RightSide/AnnotationProperty/WindowController/KMAnnotationFontWindowController.swift

@@ -233,7 +233,9 @@ class KMFontModel: NSObject {
             DispatchQueue.main.async { [weak self] in
                 guard let self = self else { return }
                 self.fontComboBox.menu = menu
-                self.fontComboBox.selectItem(at: selectedIndex)
+                if selectedIndex >= 0 && selectedIndex < menu.items.count {
+                    self.fontComboBox.selectItem(at: selectedIndex)
+                }
                 
                 let selectedStyleIndex = self.setFontStyle(fontName: self.annotationFontModel!.fontName, currentStyle: self.annotationFontModel!.fontWeight)
                 self.fontWeightPopUpButton.selectItem(at: Int(selectedStyleIndex))