Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

fix CGRect and CGPoint conversions in release build

  • Loading branch information...
commit c5236ec0887eae14f3c6fcc11f2a22736a20c74a 1 parent 1e9dc6b
@Caged Caged authored
Showing with 7 additions and 4 deletions.
  1. +2 −0  .gitattributes
  2. +5 −4 ImageViewGridLayer.m
View
2  .gitattributes
@@ -0,0 +1,2 @@
+*.xib -diff -merge
+*.pbxproj -diff -merge
View
9 ImageViewGridLayer.m
@@ -130,12 +130,13 @@ - (void)drawInContext:(CGContextRef)context
CGContextStrokePath(context);
}
--(CALayer *)hitTest:(NSPoint)aPoint {
+-(CALayer *)hitTest:(CGPoint)aPoint {
//NSLog(@"hittest x: %.f, y: %.f", aPoint.x, aPoint.y);
// don't allow any mouse clicks for subviews in this view
-
+ NSPoint hitPoint = NSPointFromCGPoint(aPoint);
+
if (owner.currentToolMode == IKToolModeAnnotate) {
- NSPoint p = [owner convertViewPointToImagePoint:aPoint];
+ NSPoint p = [owner convertViewPointToImagePoint:hitPoint];
//NSLog(@"hittest x: %.f, y: %.f", p.x, p.y);
NSSize imageSize = [owner imageSize];
NSPoint relativePoint = NSMakePoint(0, 0);
@@ -156,7 +157,7 @@ -(CALayer *)hitTest:(NSPoint)aPoint {
}
- if(NSPointInRect(aPoint,[self bounds])) {
+ if(NSPointInRect(hitPoint, NSRectFromCGRect([self bounds]))) {
return self;
} else {
return nil;
Please sign in to comment.
Something went wrong with that request. Please try again.