fix knob behaviour bug at upper limit

This commit is contained in:
jean-emmanuel 2015-11-03 18:19:23 +01:00
parent 4c51dc6f67
commit f8ca8b29dd

View file

@ -821,7 +821,7 @@ createWidget.knob = function(widgetData) {
y = data.offsetY-h/2,
angle = Math.atan2(-y, -x) * 180 / Math.PI +45,
r = angle<-90?angle+360:angle
r = (angle>-90 && angle<-45)?270:r
r = (angle>=-90 && angle<-45)?270:r
r = clip(r,[0,270])
offX = x
@ -863,7 +863,7 @@ createWidget.knob = function(widgetData) {
y = data.deltaY + offY,
angle = Math.atan2(-y, -x) * 180 / Math.PI +45,
r = angle<-90?angle+360:angle
r = (angle>-90 && angle<-45)?270:r
r = (angle>=-90 && angle<-45)?270:r
r = clip(r,[0,270])
}