Revision: 16619
          http://sourceforge.net/p/skim-app/code/16619
Author:   hofman
Date:     2026-10-06 21:16:57 +0000 (Tue, 06 Oct 2026)
Log Message:
-----------
make addPoint:toSkimNotesPath: available on iOS, usin setPoints:ofSkimNotePath:

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

Modified: trunk/SkimNotes/PDFAnnotation_SKNExtensions.h
===================================================================
--- trunk/SkimNotes/PDFAnnotation_SKNExtensions.h       2026-10-06 17:17:45 UTC 
(rev 16618)
+++ trunk/SkimNotes/PDFAnnotation_SKNExtensions.h       2026-10-06 21:16:57 UTC 
(rev 16619)
@@ -353,15 +353,13 @@
 */
 + (void)setPoints:(NSArray *)points ofSkimNotePath:(PDFKitPlatformBezierPath 
*)path;
 
-#ifndef PDFKIT_PLATFORM_IOS
 /*!
     @abstract   Method to add a point to a path, to be used to build the path 
for a Skim note.
     @param      point The point to add to the path.
     @param      path The bezier path to add the point to.
-    @discussion This method adds a cubic curve element to path to point.  It 
is used to build up paths for the Skim note from the points.  This method is 
only available on macOS.
+    @discussion This method adds a cubic curve element to path to point.  It 
is used to build up paths for the Skim note from the points.
 */
 + (void)addPoint:(NSPoint)point toSkimNotesPath:(NSBezierPath *)path;
-#endif
 
 @end
 

Modified: trunk/SkimNotes/PDFAnnotation_SKNExtensions.m
===================================================================
--- trunk/SkimNotes/PDFAnnotation_SKNExtensions.m       2026-10-06 17:17:45 UTC 
(rev 16618)
+++ trunk/SkimNotes/PDFAnnotation_SKNExtensions.m       2026-10-06 21:16:57 UTC 
(rev 16619)
@@ -1097,9 +1097,26 @@
 #endif
 }
 
-#ifndef PDFKIT_PLATFORM_IOS
-
 + (void)addPoint:(NSPoint)point toSkimNotesPath:(NSBezierPath *)path {
+#ifdef PDFKIT_PLATFORM_IOS
+    NSMutableArray *points = [NSMutableArray array];
+    
+    CGPathApplyWithBlock([path CGPath], ^(const CGPathElement *element){
+        CGPoint *p = element->points;
+        NSUInteger i = 0;
+        switch (element->type) {
+            case kCGPathElementAddQuadCurveToPoint: i = 1; break;
+            case kCGPathElementAddCurveToPoint: i = 2; break;
+            case kCGPathElementCloseSubpath: return;
+            default: i = 0; break;
+        }
+        [points addObject:[NSValue valueWithBytes:&p[i] 
objCType:@encode(CGPoint)]];
+    });
+    
+    [points addObject:[NSValue valueWithBytes:&point 
objCType:@encode(CGPoint)]];
+    
+    [self setPoints:points ofSkimNotePath:path];
+#else
     NSUInteger count = [path elementCount];
     
     if (count == 0) {
@@ -1159,10 +1176,9 @@
         [path curveToPoint:point controlPoint1:controlPoint 
controlPoint2:point];
         
     }
+#endif
 }
 
-#endif
-
 @end
 
 #pragma mark -

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