Rotary Slider stopAtEnd


#1

I’ve got a minor problem where setting stopAtEnd in Slider::setRotaryParemeters only seems to work dragging the slider one way. Dragging counter-clockwise is OK - dragging clockwise can result in the slider jumping from the maximum to the minimum.

It’s easily reproducible using the JUCE demo - just change the stopAtEnd parameter.

It’s not a big deal. I looked through the Slider code, but didn’t see any obvious way to fix it.


#2

Hmm. Just looks like I got a number wrong - try this in Slider.cpp, line 1142:

if (fabs (angle - lastAngle) > double_Pi)


#3

Thanks - that does it. I thought I had posted the same fix last night, but I must have pushed the wrong button.

The only problem with this is that it doesn’t work well for sliders with less than 180 degrees of travel. There’s probably some niftier solution involving the start and end angle, but this works fine for me.


#4