Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Fixed calculation for relative angle.

  • Loading branch information...
commit a2013cd7dd36a07bff8084ccc0efb1ee0314fa27 1 parent beb4be3
@kirbyt authored
Showing with 2 additions and 2 deletions.
  1. +2 −2 KnobSample/KnobSample/ViewController.m
View
4 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]) {
Please sign in to comment.
Something went wrong with that request. Please try again.