Browse Source

【自定义图章】添加文本注释时默认设置边框颜色,裁剪优化

niehaoyu 8 months ago
parent
commit
5f5c4c0814

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

@@ -68,10 +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 -= 3
-            foregroundBox.size.height -= 3
+            foregroundBox.origin.x += 5
+            foregroundBox.origin.y += 5
+            foregroundBox.size.width -= 10
+            foregroundBox.size.height -= 10
         }
         
         return NSIntegralRect(NSInsetRect(foregroundBox, -marginWidth, -marginHeight))

+ 3 - 1
PDF Office/PDF Master/Class/PDFWindowController/PDFListView/CPDFListViewExtension/CPDFListView+Event.m

@@ -2598,6 +2598,7 @@ static inline CPDFAreaOfInterest CAreaOfInterestForResizeHandle(CRectEdges mask,
                     originalBounds.size.width = MAX(newBounds.size.width, 30);
                     originalBounds.size.height = newBounds.size.height;
                     annotation.bounds = originalBounds;
+                    ((CPDFFreeTextAnnotation *)annotation).borderColor = NSColor.blackColor;
                 } else if (toolbarType == CSToolbarTypeDateText) {
                     ((CPDFFreeTextAnnotation *)annotation).contents = self.customStampTextValue;
                     ((CPDFFreeTextAnnotation *)annotation).customStampAnnotationType = @"dateText";
@@ -2608,7 +2609,7 @@ static inline CPDFAreaOfInterest CAreaOfInterestForResizeHandle(CRectEdges mask,
                     originalBounds.size.width = newBounds.size.width + 5;
                     originalBounds.size.height = newBounds.size.height;
                     annotation.bounds = originalBounds;
-                    
+                    ((CPDFFreeTextAnnotation *)annotation).borderColor = NSColor.blackColor;
                 } else if (toolbarType == CSToolbarTypeIdText) {
                     ((CPDFFreeTextAnnotation *)annotation).contents = self.customStampTextValue;
                     ((CPDFFreeTextAnnotation *)annotation).customStampAnnotationType = @"idText";
@@ -2620,6 +2621,7 @@ static inline CPDFAreaOfInterest CAreaOfInterestForResizeHandle(CRectEdges mask,
                     originalBounds.size.width = newBounds.size.width + 5;
                     originalBounds.size.height = newBounds.size.height;
                     annotation.bounds = originalBounds;
+                    ((CPDFFreeTextAnnotation *)annotation).borderColor = NSColor.blackColor;
                 }
                 
             }