Browse Source

【fix】【密文】涂白后,鼠标悬浮,透出的文字内容显示不全

tangchao 5 months ago
parent
commit
05d09277ba

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

@@ -307,7 +307,8 @@ private let KMPDFViewRedactAnnotationAcross = "KMPDFViewRedactAnnotationAcross"
                     let userName = KMPreference.shared.author
                     annotation?.setUserName(userName)
                     
-                    annotation?.borderWidth = 10
+//                    annotation?.borderWidth = 10
+                    annotation?.borderWidth = 4
                     if self.isWhiteOut {
                         annotation?.setBorderColor(.white)
                         annotation?.setInteriorColor(.white)
@@ -389,7 +390,8 @@ private let KMPDFViewRedactAnnotationAcross = "KMPDFViewRedactAnnotationAcross"
                 annotation?.setUserName(userName)
 
 //                if ([annotation isKindOfClass:[CPDFRedactAnnotation class]]) {
-                annotation?.borderWidth = 10
+//                annotation?.borderWidth = 10
+                annotation?.borderWidth = 4
                 if self.isWhiteOut {
                     annotation?.setBorderColor(.white)
                     annotation?.setInteriorColor(.white)

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

@@ -2294,10 +2294,11 @@ static inline CPDFAreaOfInterest CAreaOfInterestForResizeHandle(CRectEdges mask,
     CPDFRedactAnnotation *annotation = [[CPDFRedactAnnotation alloc] initWithPDFListViewNoteWith:self.document];
     for (CPDFSelection *selection in currentSelection.selectionsByLine) {
         CGRect bounds = selection.bounds;
-        [quadrilateralPoints addObject:[NSValue valueWithPoint:CGPointMake(CGRectGetMinX(bounds), CGRectGetMaxY(bounds))]];
-        [quadrilateralPoints addObject:[NSValue valueWithPoint:CGPointMake(CGRectGetMaxX(bounds), CGRectGetMaxY(bounds))]];
-        [quadrilateralPoints addObject:[NSValue valueWithPoint:CGPointMake(CGRectGetMinX(bounds), CGRectGetMinY(bounds))]];
-        [quadrilateralPoints addObject:[NSValue valueWithPoint:CGPointMake(CGRectGetMaxX(bounds), CGRectGetMinY(bounds))]];
+        CGRect theBounds = CGRectInset(bounds, -2, -2);
+        [quadrilateralPoints addObject:[NSValue valueWithPoint:CGPointMake(CGRectGetMinX(theBounds), CGRectGetMaxY(theBounds))]];
+        [quadrilateralPoints addObject:[NSValue valueWithPoint:CGPointMake(CGRectGetMaxX(theBounds), CGRectGetMaxY(theBounds))]];
+        [quadrilateralPoints addObject:[NSValue valueWithPoint:CGPointMake(CGRectGetMinX(theBounds), CGRectGetMinY(theBounds))]];
+        [quadrilateralPoints addObject:[NSValue valueWithPoint:CGPointMake(CGRectGetMaxX(theBounds), CGRectGetMinY(theBounds))]];
     }
     [annotation setModificationDate:[NSDate date]];
     [annotation setQuadrilateralPoints:quadrilateralPoints];