Revision: 14822
          http://sourceforge.net/p/skim-app/code/14822
Author:   hofman
Date:     2024-12-11 15:15:31 +0000 (Wed, 11 Dec 2024)
Log Message:
-----------
update pdf tool tip rects for anchored notes from pdfview

Modified Paths:
--------------
    trunk/SKMainWindowController.m
    trunk/SKPDFView.m

Modified: trunk/SKMainWindowController.m
===================================================================
--- trunk/SKMainWindowController.m      2024-12-11 10:37:48 UTC (rev 14821)
+++ trunk/SKMainWindowController.m      2024-12-11 15:15:31 UTC (rev 14822)
@@ -2700,16 +2700,8 @@
                 [pdfView updatedAnnotation:note forKey:keyPath 
fromValue:oldValue];
                 [secondaryPdfView updatedAnnotation:note];
                 
-                if ([keyPath isEqualToString:SKNPDFAnnotationBoundsKey]) {
-                    if ([note isNote]) {
-                        [pdfView annotationsChangedOnPage:page];
-                        [pdfView resetPDFToolTipRects];
-                    }
-                    
-                    if (note == [pdfView currentAnnotation] && 
[[NSUserDefaults standardUserDefaults] boolForKey:SKDisplayNoteBoundsKey]) {
-                        [self updateRightStatus];
-                    }
-                }
+                if ([keyPath isEqualToString:SKNPDFAnnotationBoundsKey] && 
note == [pdfView currentAnnotation] && [[NSUserDefaults standardUserDefaults] 
boolForKey:SKDisplayNoteBoundsKey])
+                    [self updateRightStatus];
                 
                 if ([self interactionMode] == SKPresentationMode && 
[presentationView page] == page)
                     [presentationView setNeedsDisplay:YES];

Modified: trunk/SKPDFView.m
===================================================================
--- trunk/SKPDFView.m   2024-12-11 10:37:48 UTC (rev 14821)
+++ trunk/SKPDFView.m   2024-12-11 15:15:31 UTC (rev 14822)
@@ -2833,8 +2833,14 @@
 - (void)updatedAnnotation:(PDFAnnotation *)annotation forKey:(NSString *)key 
fromValue:(id)oldValue {
     BOOL updateHighlight = key == nil || [key 
isEqualToString:SKNPDFAnnotationBoundsKey] || [key 
isEqualToString:SKNPDFAnnotationDrawsImageKey];
     // these properties don't notify automatically because they don't use the 
annotationValue
-    if ([annotation isNote] && ([key isEqualToString:SKNPDFAnnotationImageKey] 
|| [key isEqualToString:SKNPDFAnnotationDrawsImageKey]))
-        [super updatedAnnotation:annotation];
+    if ([annotation isNote]) {
+        if ([key isEqualToString:SKNPDFAnnotationImageKey] || [key 
isEqualToString:SKNPDFAnnotationDrawsImageKey]) {
+            [super updatedAnnotation:annotation];
+        } else if ([key isEqualToString:SKNPDFAnnotationBoundsKey]) {
+            [self annotationsChangedOnPage:[annotation page]];
+            [self resetPDFToolTipRects];
+        }
+    }
     if (updateHighlight && annotation == currentAnnotation && 
atomic_load(&highlightLayerState) != SKLayerUse) {
         CGFloat margin = (([annotation isResizable] || [annotation isNote]) ? 
HANDLE_SIZE  : 1.0) / [self scaleFactor];
         NSRect rect = [annotation bounds];

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

Reply via email to