Browse Source

【综合】自定义图章修改为模态弹窗,白边裁剪优化

niehaoyu 8 tháng trước cách đây
mục cha
commit
b32e4fc654

+ 4 - 0
PDF Office/PDF Master/Class/PDFTools/Crop/Tools/KMCropTools.swift

@@ -68,6 +68,10 @@ import Cocoa
         } else {
             let origin = NSPoint(x: foregroundBox.origin.x+bounds.origin.x, y: foregroundBox.origin.y+bounds.origin.y)
             foregroundBox.origin = origin
+            foregroundBox.origin.x += 3
+            foregroundBox.origin.y += 3
+            foregroundBox.size.width -= 5
+            foregroundBox.size.height -= 5
         }
         
         return NSIntegralRect(NSInsetRect(foregroundBox, -marginWidth, -marginHeight))

+ 8 - 1
PDF Office/PDF Master/Class/PDFTools/CustomStamp/CustomStampWindowController.swift

@@ -87,7 +87,8 @@ class CustomStampWindowController: NSWindowController, CPDFViewDelegate, CPDFLis
         self.pdfView.document = pdfDocument
         self.pdfView.delegate = self
         self.pdfView.pdfListViewDelegate = self
-        self.pdfView.autoScales = true
+        self.pdfView.autoScales = false
+        self.pdfView.scaleFactor = 1
         self.pdfView.isCustomStampType = "1"
         
         self.pdfContendView.wantsLayer = true
@@ -192,6 +193,12 @@ class CustomStampWindowController: NSWindowController, CPDFViewDelegate, CPDFLis
         }
     }
     
+    func clear() {
+        self.removeEventMonitor()
+        CustomStampWindowController.currentWindowController = nil
+        NotificationCenter.default.removeObserver(self)
+    }
+    
     //MARK: Private Method
     func chooseImage() {
         let accessoryCtr = KMImageAccessoryController()

+ 5 - 1
PDF Office/PDF Master/Class/PDFWindowController/Side/RightSide/StampList/KMAnnotationStampViewController.swift

@@ -1125,8 +1125,12 @@ let KMPDFDynamicStampNeedAuthorKey1 = "km_pdfview_dynamic_stamp_need_author"
                     self?.createStampTableView.reloadData()
                 }
             }
-            windowVC.close()
+            self?.view.window?.endSheet(windowVC.window!)
+            windowVC.clear()
         }
+        self.view.window?.beginSheet(customStampWC.window!, completionHandler: { response in
+            
+        })
     }