Revision: 16527
http://sourceforge.net/p/skim-app/code/16527
Author: hofman
Date: 2026-09-22 22:03:08 +0000 (Tue, 22 Sep 2026)
Log Message:
-----------
only fix order of quad points we may have done wrong in the past
Modified Paths:
--------------
trunk/SkimNotes/PDFAnnotation_SKNExtensions.m
Modified: trunk/SkimNotes/PDFAnnotation_SKNExtensions.m
===================================================================
--- trunk/SkimNotes/PDFAnnotation_SKNExtensions.m 2026-09-22 21:41:32 UTC
(rev 16526)
+++ trunk/SkimNotes/PDFAnnotation_SKNExtensions.m 2026-09-22 22:03:08 UTC
(rev 16527)
@@ -2045,14 +2045,6 @@
--------
*/
-#ifndef PDFKIT_PLATFORM_IOS
-static inline void swapPoints(NSPoint p[4], NSUInteger i, NSUInteger j) {
- NSPoint tmp = p[i];
- p[i] = p[j];
- p[j] = tmp;
-}
-#endif
-
static inline NSArray *quadrilateralPointsFromPointStrings(NSArray
*pointStrings) {
NSMutableArray *quadPoints = [[NSMutableArray alloc]
initWithCapacity:[pointStrings count]];
#ifdef PDFKIT_PLATFORM_IOS
@@ -2070,17 +2062,12 @@
p[j] = NSPointFromString([pointStrings objectAtIndex:4 * i + j]);
// p[0]-p[1] should be in the same direction as p[2]-p[3]
if ((p[1].x - p[0].x) * (p[3].x - p[2].x) + (p[1].y - p[0].y) *
(p[3].y - p[2].y) < 0.0) {
- swapPoints(p, 2, 3);
+ NSPoint tmp = p[2];
+ p[2] = p[3];
+ p[3] = tmp;
}
- // p[0], p[1], p[2] should be ordered clockwise
- if ((p[1].y - p[0].y) * (p[2].x - p[0].x) - (p[1].x - p[0].x) *
(p[2].y - p[0].y) < 0.0) {
- swapPoints(p, 0, 2);
- swapPoints(p, 1, 3);
- }
- for (j = 0; j < 4; j++) {
- NSValue *value = [[NSValue alloc] initWithBytes:&p[j]
objCType:@encode(NSPoint)];
- [quadPoints addObject:value];
- }
+ for (j = 0; j < 4; j++)
+ [quadPoints addObject:[NSValue valueWithPoint:p[j]]];
}
#endif
return quadPoints;
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