Revision: 16575
          http://sourceforge.net/p/skim-app/code/16575
Author:   hofman
Date:     2026-09-30 09:34:49 +0000 (Wed, 30 Sep 2026)
Log Message:
-----------
get bounds only when needed

Modified Paths:
--------------
    trunk/SkimNotes/PDFAnnotation_SKNExtensions.m

Modified: trunk/SkimNotes/PDFAnnotation_SKNExtensions.m
===================================================================
--- trunk/SkimNotes/PDFAnnotation_SKNExtensions.m       2026-09-29 15:58:42 UTC 
(rev 16574)
+++ trunk/SkimNotes/PDFAnnotation_SKNExtensions.m       2026-09-30 09:34:49 UTC 
(rev 16575)
@@ -720,7 +720,6 @@
     if ([self respondsToSelector:@selector(valueForAnnotationKey:)]) {
         
         NSString *type = [self type];
-        PDFRect bounds = [self bounds];
         id value = nil;
         Class arrayClass = [NSArray class];
         Class stringClass = [NSString class];
@@ -776,6 +775,7 @@
                     [dict setValue:SKNStringFromPoint([(id)self endPoint]) 
forKey:SKNPDFAnnotationEndPointKey];
                 } else if ((value = [self valueForAnnotationKey:@"/L"])) {
                     if ([value isKindOfClass:arrayClass] && [value count] == 
4) {
+                        PDFRect bounds = [self bounds];
                         PDFPoint p = SKNMakePoint([[value objectAtIndex:0] 
doubleValue] - bounds.origin.x, [[value objectAtIndex:1] doubleValue] - 
bounds.origin.y);
                         [dict setValue:SKNStringFromPoint(p) 
forKey:SKNPDFAnnotationStartPointKey];
                         p = SKNMakePoint([[value objectAtIndex:2] doubleValue] 
- bounds.origin.x, [[value objectAtIndex:3] doubleValue] - bounds.origin.y);
@@ -797,6 +797,7 @@
                 }
             } else if ((value = [self valueForAnnotationKey:@"/QuadPoints"])) {
                 if ([value isKindOfClass:arrayClass] && [value count] % 4 == 
0) {
+                    PDFRect bounds = [self bounds];
                     Class numberClass = [NSNumber class];
                     Class valueClass = [NSValue class];
                     NSMutableArray *quadPoints = [NSMutableArray array];
@@ -845,6 +846,7 @@
                         if ([path isKindOfClass:pathClass]) {
                             [points addObjectsFromArray:[[self class] 
pointsFromSkimNotePath:path]];
                         } else if ([path isKindOfClass:arrayClass]) {
+                            PDFRect bounds = [self bounds];
                             NSUInteger i, iMax = [path count];
                             for (i = 0; i < iMax; i++) {
                                 NSValue *val = [path objectAtIndex:i];

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