Revision: 4626
http://skim-app.svn.sourceforge.net/skim-app/?rev=4626&view=rev
Author: hofman
Date: 2008-09-14 17:40:55 +0000 (Sun, 14 Sep 2008)
Log Message:
-----------
Use relative point for hittest
Modified Paths:
--------------
trunk/PDFAnnotationInk_SKExtensions.m
Modified: trunk/PDFAnnotationInk_SKExtensions.m
===================================================================
--- trunk/PDFAnnotationInk_SKExtensions.m 2008-09-14 17:37:29 UTC (rev
4625)
+++ trunk/PDFAnnotationInk_SKExtensions.m 2008-09-14 17:40:55 UTC (rev
4626)
@@ -42,7 +42,7 @@
#import "SKStringConstants.h"
#import "SKFDFParser.h"
#import "NSUserDefaults_SKExtensions.h"
-#import "SKGeometry.h"
+#import "NSGeometry_SKExtensions.h"
@implementation PDFAnnotationInk (SKExtensions)
@@ -92,9 +92,7 @@
- (BOOL)isConvertibleAnnotation { return NO; }
- (BOOL)hitTest:(NSPoint)point {
- NSRect bounds = [self bounds];
- NSPoint startPoint = [self startPoint];
- NSPoint endPoint = [self endPoint];
+ NSPoint relPoint = SKSubstractPoints(point, [self bounds].origin);
if ([super hitTest:point]) {
NSEnumerator *pathEnum = [[self paths] objectEnumerator];
@@ -109,7 +107,7 @@
element = [path elementAtIndex:i associatedPoints:points];
prevPoint = nextPoint;
nextPoint = element == NSCurveToBezierPathElement ? points[2]
: points[0];
- if (i > 0 && SKPointNearLineFromPointToPoint(point, prevPoint,
nextPoint, 4.0))
+ if (i > 0 && SKPointNearLineFromPointToPoint(relPoint,
prevPoint, nextPoint, 4.0))
return YES;
}
}
This was sent by the SourceForge.net collaborative development platform, the
world's largest Open Source development site.
-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Skim-app-commit mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/skim-app-commit