Permalink
Browse files

Fixed calculation for relative angle.

  • Loading branch information...
1 parent beb4be3 commit a2013cd7dd36a07bff8084ccc0efb1ee0314fa27 @kirbyt committed Mar 1, 2012
Showing with 2 additions and 2 deletions.
  1. +2 −2 KnobSample/KnobSample/ViewController.m
@@ -54,7 +54,7 @@ - (void)viewDidLoad
[[self knobImageView] setUserInteractionEnabled:YES];
// Allow rotation between the start and stop angles.
- [self setStartAngle:270.0];
+ [self setStartAngle:-90.0];
[self setStopAngle:90.0];
[self resetKnob:self];
@@ -64,7 +64,7 @@ - (void)rotated:(KTOneFingerRotationGestureRecognizer *)recognizer
{
CGFloat degrees = radiansToDegrees([recognizer rotation]);
CGFloat currentAngle = [self currentAngle] + degrees;
- CGFloat relativeAngle = fabsf(fmodf(currentAngle, 360.0)); // Converts to angle between 0 and 360 degrees.
+ CGFloat relativeAngle = fmodf(currentAngle, 360.0); // Converts to angle between 0 and 360 degrees.
BOOL shouldRotate = NO;
if ([self startAngle] <= [self stopAngle]) {

0 comments on commit a2013cd

Please sign in to comment.