Browse Source

【注释】高亮注释刷新逻辑调整

lizhe 7 months ago
parent
commit
fe36cc82f1

+ 2 - 1
PDF Office/PDF Master/Class/PDFWindowController/PDFListView/CPDFListView.m

@@ -914,7 +914,7 @@ NSNotificationName const CPDFListViewDisplayModeChangeNotification = @"CPDFListV
         CFRelease(frameRef);
         CFRelease(framesetter);
         [NSGraphicsContext restoreGraphicsState];
-        CGContextRestoreGState(context);        
+        CGContextRestoreGState(context);
     }
 }
 
@@ -1178,6 +1178,7 @@ NSNotificationName const CPDFListViewDisplayModeChangeNotification = @"CPDFListV
     }
     [page addAnnotation:annotation];
     [self setNeedsDisplayAnnotation:annotation];
+    [self updateHighLightAnnotation:annotation];
     [[self undoManager] setActionName:NSLocalizedString(@"Add Note", @"Undo action name")];
         
     dispatch_async(dispatch_get_main_queue(), ^{

+ 2 - 0
PDF Office/PDF Master/Class/PDFWindowController/PDFListView/CPDFListViewExtension/CPDFListView+Tool.h

@@ -45,6 +45,8 @@ typedef NS_ENUM(NSInteger, CAnnotationAlignState) {
 
 - (void)setNeedsDisplayAnnotation:(CPDFAnnotation *)annotation;
 
+- (void)updateHighLightAnnotation:(CPDFAnnotation *)annotation;
+
 - (void)requiresDisplay;
 
 - (NSRect)visibleContentRect;

+ 6 - 0
PDF Office/PDF Master/Class/PDFWindowController/PDFListView/CPDFListViewExtension/CPDFListView+Tool.m

@@ -320,6 +320,12 @@
     }
 }
 
+- (void)updateHighLightAnnotation:(CPDFAnnotation *)annotation {
+    if (annotation && [annotation.type isEqualToString:@"Highlight"]) {
+        [self updateHighLightAnnotationViewForPage:annotation.page];
+    }
+}
+
 - (NSRect)convertRectToScreen:(NSRect)rect {
     rect = [self convertRect:rect toView:nil];
     rect.origin = [[self window] convertBaseToScreen:rect.origin];