You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
func moveHandle(lastPoint:CGPoint){
//Get the center
let centerPoint:CGPoint = CGPointMake(self.frame.size.width/2, self.frame.size.height/2);
//Calculate the direction from a center point and a arbitrary position.
//bug fix:
var currentAngle:Double = AngleFromNorth(centerPoint, p2: lastPoint, flipped: false);
if currentAngle.isNaN {
currentAngle = 0
}
let angleInt = Int(floor(currentAngle))
//Store the new angle
angle = Int(360 - angleInt)
//Update the textfield
textField!.text = "\(angle)"
//Redraw
setNeedsDisplay()
}
If the user's drag coordinate is at the centre of the CircularSlider, a crash occurs because of a "divide by zero" issue.
The text was updated successfully, but these errors were encountered: