فهرست منبع

Merge branch 'develop_2025' of git.kdan.cc:Mac_PDF/PDF_Office into develop_2025

niehaoyu 3 هفته پیش
والد
کامیت
6d089813ad

+ 52 - 70
PDF Office/PDF Master/Class/PDFWindowController/PDFListView/CPDFKitExtensions/CPDFListViewExtension/CPDFListView+Event.m

@@ -3546,80 +3546,62 @@ static inline CPDFAreaOfInterest CAreaOfInterestForResizeHandle(CRectEdges mask,
         }
     } else if ([activeAnnotation isKindOfClass:[CPDFStampAnnotation class]] && isCreatAnnotation == NO) {
         CPDFStampAnnotation *stampAnnotation = (CPDFStampAnnotation *)activeAnnotation;
-        CPDFStampDraggedType draggedIndex = -1;
-        if ((resizeHandle & CMaxXEdgeMask) && (resizeHandle & CMinYEdgeMask)) {
-            draggedIndex = 2;
-        } else if ((resizeHandle & CMaxXEdgeMask) && (resizeHandle & CMaxYEdgeMask)) {
-            draggedIndex = 4;
-        } else if ((resizeHandle & CMinXEdgeMask) && (resizeHandle & CMaxYEdgeMask)) {
-            draggedIndex = 6;
-        } else if ((resizeHandle & CMinXEdgeMask) && (resizeHandle & CMinYEdgeMask)) {
-            draggedIndex = 0;
-        } else if (resizeHandle & CMinXEdgeMask) {
-            draggedIndex = 7;
-        } else if (resizeHandle & CMaxXEdgeMask) {
-            draggedIndex = 3;
-        } else if (resizeHandle & CMinYEdgeMask) {
-            draggedIndex = 1;
-        } else if (resizeHandle & CMaxYEdgeMask) {
-            draggedIndex = 5;
-        }
-        if (draggedIndex == -1) {
-            return;
+        if(stampAnnotation == 0) {
+            [stampAnnotation setBounds:NSIntegralRect(newBounds)];
+        } else {
+            CPDFStampDraggedType draggedIndex = -1;
+            if ((resizeHandle & CMaxXEdgeMask) && (resizeHandle & CMinYEdgeMask)) {
+                draggedIndex = 2;
+            } else if ((resizeHandle & CMaxXEdgeMask) && (resizeHandle & CMaxYEdgeMask)) {
+                draggedIndex = 4;
+            } else if ((resizeHandle & CMinXEdgeMask) && (resizeHandle & CMaxYEdgeMask)) {
+                draggedIndex = 6;
+            } else if ((resizeHandle & CMinXEdgeMask) && (resizeHandle & CMinYEdgeMask)) {
+                draggedIndex = 0;
+            } else if (resizeHandle & CMinXEdgeMask) {
+                draggedIndex = 7;
+            } else if (resizeHandle & CMaxXEdgeMask) {
+                draggedIndex = 3;
+            } else if (resizeHandle & CMinYEdgeMask) {
+                draggedIndex = 1;
+            } else if (resizeHandle & CMaxYEdgeMask) {
+                draggedIndex = 5;
+            }
+            if (draggedIndex == -1) {
+                return;
+            }
+            [stampAnnotation dragStampAnnotationWithCurrentPagePoint:currentPagePoint draggedIndex:draggedIndex];
         }
-        [stampAnnotation dragStampAnnotationWithCurrentPagePoint:currentPagePoint draggedIndex:draggedIndex];
     }
     else if ([activeAnnotation isKindOfClass:[CPDFSignatureAnnotation class]] && isCreatAnnotation == NO) {
         CPDFSignatureAnnotation *signatureAnnotation = (CPDFSignatureAnnotation *)activeAnnotation;
-        CPDFSignatureDraggedType draggedIndex = -1;
-        if ((resizeHandle & CMaxXEdgeMask) && (resizeHandle & CMinYEdgeMask)) {
-            draggedIndex = 2;
-        } else if ((resizeHandle & CMaxXEdgeMask) && (resizeHandle & CMaxYEdgeMask)) {
-            draggedIndex = 4;
-        } else if ((resizeHandle & CMinXEdgeMask) && (resizeHandle & CMaxYEdgeMask)) {
-            draggedIndex = 6;
-        } else if ((resizeHandle & CMinXEdgeMask) && (resizeHandle & CMinYEdgeMask)) {
-            draggedIndex = 0;
-        } else if (resizeHandle & CMinXEdgeMask) {
-            draggedIndex = 7;
-        } else if (resizeHandle & CMaxXEdgeMask) {
-            draggedIndex = 3;
-        } else if (resizeHandle & CMinYEdgeMask) {
-            draggedIndex = 1;
-        } else if (resizeHandle & CMaxYEdgeMask) {
-            draggedIndex = 5;
-        }
-        if (draggedIndex == -1) {
-            return;
+        if(signatureAnnotation == 0) {
+            [signatureAnnotation setBounds:NSIntegralRect(newBounds)];
+        } else {
+            CPDFSignatureDraggedType draggedIndex = -1;
+            if ((resizeHandle & CMaxXEdgeMask) && (resizeHandle & CMinYEdgeMask)) {
+                draggedIndex = 2;
+            } else if ((resizeHandle & CMaxXEdgeMask) && (resizeHandle & CMaxYEdgeMask)) {
+                draggedIndex = 4;
+            } else if ((resizeHandle & CMinXEdgeMask) && (resizeHandle & CMaxYEdgeMask)) {
+                draggedIndex = 6;
+            } else if ((resizeHandle & CMinXEdgeMask) && (resizeHandle & CMinYEdgeMask)) {
+                draggedIndex = 0;
+            } else if (resizeHandle & CMinXEdgeMask) {
+                draggedIndex = 7;
+            } else if (resizeHandle & CMaxXEdgeMask) {
+                draggedIndex = 3;
+            } else if (resizeHandle & CMinYEdgeMask) {
+                draggedIndex = 1;
+            } else if (resizeHandle & CMaxYEdgeMask) {
+                draggedIndex = 5;
+            }
+            if (draggedIndex == -1) {
+                return;
+            }
+            [signatureAnnotation dragSignatureAnnotationWithCurrentPagePoint:currentPagePoint draggedIndex:draggedIndex];
         }
-        [signatureAnnotation dragSignatureAnnotationWithCurrentPagePoint:currentPagePoint draggedIndex:draggedIndex];
-    }
-//    else if ([activeAnnotation isKindOfClass:[CPDFSignatureWidgetAnnotation class]]) {
-//        CPDFSignatureWidgetAnnotation *signatureWidgetAnnotation = (CPDFSignatureWidgetAnnotation *)activeAnnotation;
-//        CPDFSignatureWidgetDraggedType draggedIndex = -1;
-//        if ((resizeHandle & CMaxXEdgeMask) && (resizeHandle & CMinYEdgeMask)) {
-//            draggedIndex = 2;
-//        } else if ((resizeHandle & CMaxXEdgeMask) && (resizeHandle & CMaxYEdgeMask)) {
-//            draggedIndex = 4;
-//        } else if ((resizeHandle & CMinXEdgeMask) && (resizeHandle & CMaxYEdgeMask)) {
-//            draggedIndex = 6;
-//        } else if ((resizeHandle & CMinXEdgeMask) && (resizeHandle & CMinYEdgeMask)) {
-//            draggedIndex = 0;
-//        } else if (resizeHandle & CMinXEdgeMask) {
-//            draggedIndex = 7;
-//        } else if (resizeHandle & CMaxXEdgeMask) {
-//            draggedIndex = 3;
-//        } else if (resizeHandle & CMinYEdgeMask) {
-//            draggedIndex = 1;
-//        } else if (resizeHandle & CMaxYEdgeMask) {
-//            draggedIndex = 5;
-//        }
-//        if (draggedIndex == -1) {
-//            return;
-//        }
-//        [signatureWidgetAnnotation dragSignatureWidgetAnnotationWithCurrentPagePoint:currentPagePoint draggedIndex:draggedIndex];
-//    }
-    else {
+    } else {
         [activeAnnotation setBounds:NSIntegralRect(newBounds)];
     }
     
@@ -5591,8 +5573,8 @@ static inline CPDFAreaOfInterest CAreaOfInterestForResizeHandle(CRectEdges mask,
                     newAnnotation.lineOpacity = originalAnnotation.lineOpacity;
                     newAnnotation.lineColor = originalAnnotation.lineColor;
                     
-                    [self addActiveAnnotations:@[newAnnotation]];
                     [self addAnnotation:newAnnotation toPage:page];
+                    [self addActiveAnnotations:@[newAnnotation]];
                     [newAnnotation updateAppearanceStream];
                 } else if ([an isKindOfClass:[CPDFListStampAnnotation class]]) {
                     CPDFListStampAnnotation *newAnnotation = nil;

+ 2 - 2
PDF Office/PDF Master/Class/PDFWindowController/PDFListView/CPDFKitExtensions/CPDFListViewExtension/CPDFListView+Tool.m

@@ -839,8 +839,8 @@
             width = [userDefaults floatForKey:CDefaultSignLineNoteWidthKey] < 0.001 ? 16 : [userDefaults floatForKey:CDefaultSignLineNoteWidthKey];
             break;
         case CAnnotationTypeSignDot:
-            height = [userDefaults floatForKey:CDefaultSignDotNoteHeightKey] < 0.001 ? 16 : [userDefaults floatForKey:CDefaultSignDotNoteHeightKey];
-            width = [userDefaults floatForKey:CDefaultSignDotNoteWidthKey] < 0.001 ? 16 : [userDefaults floatForKey:CDefaultSignDotNoteWidthKey];
+            height = [userDefaults floatForKey:CDefaultSignDotNoteHeightKey] < 0.001 ? 14 : [userDefaults floatForKey:CDefaultSignDotNoteHeightKey];
+            width = [userDefaults floatForKey:CDefaultSignDotNoteWidthKey] < 0.001 ? 14 : [userDefaults floatForKey:CDefaultSignDotNoteWidthKey];
             break;
         default:
             height = [userDefaults floatForKey:CDefaultNoteHeightKey];

+ 1 - 1
PDF Office/PDF Master/KMClass/KMNPDFPageEdit/KMNThumbnailView/KMNThumbnailBaseViewController+Action.swift

@@ -1043,7 +1043,7 @@ extension KMNThumbnailBaseViewController {
         return params[1] as? URL
     }
     
-    private func km_open_file_multi(type: KMPasswordInputWindowType = .open, progressBlock: ((_ index: Int, _ params: Any...)->Void)? = nil, completionBlock:@escaping ([CPDFDocument])->Void) {
+    private func km_open_file_multi(type: KMPasswordInputWindowType = .owner, progressBlock: ((_ index: Int, _ params: Any...)->Void)? = nil, completionBlock:@escaping ([CPDFDocument])->Void) {
         NSPanel.km_open_multi_success(self.view.window!) { panel in
             var array: [String] = []
             for fileType in KMConvertPDFManager.supportFileType() {

+ 2 - 2
PDF Office/PDF Master/KMClass/KMPDFViewController/KMMainViewController.swift

@@ -1060,8 +1060,8 @@ struct KMNMWCFlags {
     
     //MARK: - 页面编辑
     func enterPageEditMode() {
-        pageEditViewController = KMNPageEditViewController(self.document)
-        if(pageEditViewController != nil) {
+        if(pageEditViewController == nil) {
+            pageEditViewController = KMNPageEditViewController(self.document)
             pageEditViewController?.view.frame = bottomContendBox.bounds
             pageEditViewController?.thumbnailBaseViewDelegate = self
             pageEditViewController?.selectionIndexPaths = [IndexPath(item: listView.currentPageIndex, section: 0)]