Revision: 14783
          http://sourceforge.net/p/skim-app/code/14783
Author:   hofman
Date:     2024-12-08 14:51:25 +0000 (Sun, 08 Dec 2024)
Log Message:
-----------
No need to redraw alternate pdfviews when annotations change, they aren't drawn 
on the pdf image

Modified Paths:
--------------
    trunk/PDFView_SKExtensions.m

Modified: trunk/PDFView_SKExtensions.m
===================================================================
--- trunk/PDFView_SKExtensions.m        2024-12-07 15:34:11 UTC (rev 14782)
+++ trunk/PDFView_SKExtensions.m        2024-12-08 14:51:25 UTC (rev 14783)
@@ -114,10 +114,11 @@
 }
 
 - (void)setNeedsDisplayForAnnotation:(PDFAnnotation *)annotation 
onPage:(PDFPage *)page {
-    [self setNeedsDisplayInRect:[annotation displayRect] ofPage:page];
     NSView *pageView = [self safePageViewForPage:page];
     if (pageView)
         [pageView updateAnnotation:annotation];
+    else
+        [self setNeedsDisplayInRect:[annotation displayRect] ofPage:page];
     [self annotationsChangedOnPage:page];
 }
 
@@ -130,18 +131,20 @@
 }
 
 - (void)setNeedsDisplayForAddedAnnotation:(PDFAnnotation *)annotation 
onPage:(PDFPage *)page {
-    [self setNeedsDisplayInRect:[annotation displayRect] ofPage:page];
     NSView *pageView = [self safePageViewForPage:page];
     if (pageView)
         [pageView addAnnotation:annotation];
+    else
+        [self setNeedsDisplayInRect:[annotation displayRect] ofPage:page];
     [self annotationsChangedOnPage:page];
 }
 
 - (void)setNeedsDisplayForRemovedAnnotation:(PDFAnnotation *)annotation 
onPage:(PDFPage *)page {
-    [self setNeedsDisplayInRect:[annotation displayRect] ofPage:page];
     NSView *pageView = [self safePageViewForPage:page];
     if (pageView)
         [pageView removeAnnotation:annotation];
+    else
+        [self setNeedsDisplayInRect:[annotation displayRect] ofPage:page];
     [self annotationsChangedOnPage:page];
 }
 

This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.



_______________________________________________
Skim-app-commit mailing list
Skim-app-commit@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/skim-app-commit

Reply via email to