Permalink
Browse files

Updated to highlight a drag path too close to the center.

  • Loading branch information...
1 parent 9c228b0 commit 0413d8ce15b178358805abd72f421ebb8764f757 @funkyboy committed Mar 1, 2012
@@ -206,8 +206,6 @@ - (BOOL)beginTrackingWithTouch:(UITouch *)touch withEvent:(UIEvent *)event {
return NO;
}
-
-
float dx = touchPoint.x - container.center.x;
float dy = touchPoint.y - container.center.y;
deltaAngle = atan2(dy,dx);
@@ -225,6 +223,21 @@ - (BOOL)continueTrackingWithTouch:(UITouch*)touch withEvent:(UIEvent*)event
{
CGPoint pt = [touch locationInView:self];
+
+ float dist = [self calculateDistanceFromCenter:pt];
+
+ if (dist < 40 || dist > 100)
+ {
+ // a drag path too close to the center
+ NSLog(@"drag path too close to the center (%f,%f)", pt.x, pt.y);
+
+ // here you might want to implement your solution when the drag
+ // is too close to the center
+ // You might go back to the clove previously selected
+ // or you might calculate the clove corresponding to
+ // the "exit point" of the drag.
+
+ }
float dx = pt.x - container.center.x;
float dy = pt.y - container.center.y;

0 comments on commit 0413d8c

Please sign in to comment.