Revision: 14790
http://sourceforge.net/p/skim-app/code/14790
Author: hofman
Date: 2024-12-08 17:10:20 +0000 (Sun, 08 Dec 2024)
Log Message:
-----------
Only really redraw when changing the bounds of a note
Modified Paths:
--------------
trunk/SKMainWindowController.m
trunk/SKPDFView.h
trunk/SKPDFView.m
Modified: trunk/SKMainWindowController.m
===================================================================
--- trunk/SKMainWindowController.m 2024-12-08 16:30:28 UTC (rev 14789)
+++ trunk/SKMainWindowController.m 2024-12-08 17:10:20 UTC (rev 14790)
@@ -2706,7 +2706,7 @@
}
}
- [pdfView setNeedsDisplayForAnnotation:note fromRect:oldRect];
+ [pdfView setNeedsDisplay:([keyPath
isEqualToString:SKNPDFAnnotationBorderKey] || NSIsEmptyRect(oldRect) == NO)
forAnnotation:note fromRect:oldRect];
[secondaryPdfView setNeedsDisplayForAnnotation:note];
if ([keyPath isEqualToString:SKNPDFAnnotationBoundsKey]) {
Modified: trunk/SKPDFView.h
===================================================================
--- trunk/SKPDFView.h 2024-12-08 16:30:28 UTC (rev 14789)
+++ trunk/SKPDFView.h 2024-12-08 17:10:20 UTC (rev 14790)
@@ -256,7 +256,7 @@
- (void)undoManagerDidOpenOrCloseUndoGroup;
-- (void)setNeedsDisplayForAnnotation:(PDFAnnotation *)annotation
fromRect:(NSRect)oldRect;
+- (void)setNeedsDisplay:(BOOL)needsRedraw forAnnotation:(PDFAnnotation
*)annotation fromRect:(NSRect)oldRect;
@end
Modified: trunk/SKPDFView.m
===================================================================
--- trunk/SKPDFView.m 2024-12-08 16:30:28 UTC (rev 14789)
+++ trunk/SKPDFView.m 2024-12-08 17:10:20 UTC (rev 14790)
@@ -2834,10 +2834,10 @@
[self goToRect:[annotation bounds] onPage:[annotation page]];
}
-- (void)setNeedsDisplayForAnnotation:(PDFAnnotation *)annotation
fromRect:(NSRect)oldRect {
+- (void)setNeedsDisplay:(BOOL)needsRedraw forAnnotation:(PDFAnnotation
*)annotation fromRect:(NSRect)oldRect {
PDFPage *page = [annotation page];
[self annotationsChangedOnPage:page];
- if (annotation == currentAnnotation && atomic_load(&highlightLayerState)
!= SKLayerUse) {
+ if (annotation == currentAnnotation && atomic_load(&highlightLayerState)
!= SKLayerUse && needsRedraw) {
NSRect rect = NSUnionRect([annotation displayRect], oldRect);
if (annotation == currentAnnotation) {
CGFloat margin = (([annotation isResizable] || [annotation
isNote]) ? HANDLE_SIZE : 1.0) / [self scaleFactor];
@@ -2850,7 +2850,7 @@
}
- (void)setNeedsDisplayForAnnotation:(PDFAnnotation *)annotation {
- [self setNeedsDisplayForAnnotation:annotation fromRect:NSZeroRect];
+ [self setNeedsDisplay:YES forAnnotation:annotation fromRect:NSZeroRect];
}
- (void)setNeedsDisplayForReadingBarBounds:(NSRect)rect onPage:(PDFPage *)page
{
This was sent by the SourceForge.net collaborative development platform, the
world's largest Open Source development site.
_______________________________________________
Skim-app-commit mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/skim-app-commit