Quellcode durchsuchen

【文字图片编辑】文字图片esc取消逻辑梳理完善

lizhe vor 1 Jahr
Ursprung
Commit
3109d75c09

+ 4 - 3
PDF Office/PDF Master/Class/PDFWindowController/PDFListView/CPDFListViewExtension/CPDFListView+KeyEvent.m

@@ -91,10 +91,11 @@
             [self setNeedsDisplayAnnotationViewForPage:page];
         }
     } else if (CAnnotationTypeUnkown != [self annotationType] && eventChar == CPDFListEscapeCharacter) {
-//        if ((self.toolMode == CEditPDFToolMode) && (self.annotationType == CAnnotationTypeAddText || self.annotationType == CAnnotationTypeAddImage)) {
+        if ((self.toolMode == CEditPDFToolMode) && (self.annotationType == CAnnotationTypeAddText || self.annotationType == CAnnotationTypeAddImage)) {
 //            [[NSNotificationCenter defaultCenter] postNotificationName:@"CEditPDFToolModeChangeStateUnkown" object:self];
-//        }
-        [self setAnnotationType:CAnnotationTypeUnkown];
+        } else {
+            [self setAnnotationType:CAnnotationTypeUnkown];
+        }
     } else if(self.activeAnnotations.count > 0 && eventChar == CPDFListEscapeCharacter){
         [self updateActiveAnnotations:@[]];
         [self setNeedsDisplayAnnotationViewForVisiblePages];

+ 8 - 2
PDF Office/PDF Master/Class/PDFWindowController/ViewController/KMMainViewController.swift

@@ -1238,6 +1238,10 @@ import Cocoa
                                 self?.listView.updateEditing([])
                                 self?.listView.isEditImage = false
                                 self?.listView.setNeedsDisplayPageViewFor(self!.listView.currentPage())
+                                if self?.listView.annotationType == .addImage {
+                                    self?.listView.change([.text, .image])
+                                }
+                                self?.listView.annotationType = .editTextImage
                                 self?.closeRightPane()
                             } else if(self?.listView.annotationType == .addImage || self!.listView.annotationType == .addText) {
                                 if self?.listView.annotationType == .addImage ||
@@ -1544,8 +1548,10 @@ import Cocoa
 //                        if self.listView.annotationType == .addImage {
 //                            self.closeRightPane()
 //                        }
-                        if self.rightSideViewController.eidtPDFImageProperty != nil {
-                            self.rightSideViewController.eidtPDFImageProperty.reloadData()
+                        if self.listView.annotationType == .addImage {
+                            if self.rightSideViewController.eidtPDFImageProperty != nil {
+                                self.rightSideViewController.eidtPDFImageProperty.reloadData()
+                            }
                         }
 //                        self.openRightPane()
                     }