Revision: 16246
          http://sourceforge.net/p/skim-app/code/16246
Author:   hofman
Date:     2026-05-07 21:09:32 +0000 (Thu, 07 May 2026)
Log Message:
-----------
add selections at once

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

Modified: trunk/PDFAnnotationMarkup_SKExtensions.m
===================================================================
--- trunk/PDFAnnotationMarkup_SKExtensions.m    2026-05-07 17:51:54 UTC (rev 
16245)
+++ trunk/PDFAnnotationMarkup_SKExtensions.m    2026-05-07 21:09:32 UTC (rev 
16246)
@@ -199,6 +199,7 @@
 
 - (PDFSelection *)selectionWithPage:(PDFPage *)page {
     PDFSelection *selection = nil;
+    NSMutableArray *selections = nil;
     NSPointerArray *lines = [self lineRects];
     NSUInteger i, iMax = [lines count];
     
@@ -206,12 +207,16 @@
         // slightly outset the rect to avoid rounding errors, as 
selectionForRect is pretty strict in some OS versions, but unfortunately not in 
others
         PDFSelection *sel = [page selectionForRect:NSInsetRect([lines 
rectAtIndex:i], -1.0, -1.0)];
         if ([sel hasCharacters]) {
-            if (selection)
-                [selection addSelection:sel];
+            if (selection == nil)
+                selection = sel;
+            else if (selections)
+                [selections addObject:sel];
             else
-                selection = sel;
+                selections = [NSMutableArray arrayWithObject:sel];
         }
     }
+    if (selections)
+        [selection addSelections:selections];
     return selection;
 }
 

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