Bug with Slider::setRotaryParameters


#1

I have a bug with the stopAtEnd parameter of setRotaryParameters:

If I do:

theKnob->setSliderStyle (Slider::Rotary);
theKnob->setRotaryParameters( float_Pi, float_Pi *3, false);

the knob do rotate indefinitely, but if I do:

theKnob->setSliderStyle (Slider::RotaryVerticalDrag);
theKnob->setRotaryParameters( float_Pi, float_Pi *3, false);

The value doesn’t wrap around, even if stopAtEnd is set to false. Tested on iOS and Android.


#2

Not really a bug… If the slider’s in vertical drag mode, then it won’t wrap the value. The stopAtEnd parameter only really has a meaning when the mouse is being moved in a circle and can end up back at its starting point.


#3

I found this post after searching to discover if this behavior was a known bug or not.  I agree with @shini, this seems like a bug to me, and should be fixed so that as you're dragging, the slider will wrap around if it reaches one end and the user continues the dragging gesture in the same direction.  Alternatively, if the documentation for stopAtEnd would mention that it only has meaning for Rotary style, not other styles such as RotaryHorizontalVerticalDrag, that would also be acceptable.


#4

I really don't see it as a bug!

The only reason that stopAtEnd exists is because when the motion is circular, you can end up back where you started - you can't do that when moving linearly, so it seems odd to me that you'd expect the value to keep snapping back.

(I will update the docs though!)


#5

I, too, see this as a bug.  There are certainly valid use cases where you would not want a rotary slider to hit a hard stop at any point along its rotation.  One example: Azimuth.  You wouldn't want to force the user to go back a full rotation to go from 359 degrees to 1 degree.  And the preference for circular vs. linear drag to manipulate knobs on UIs is about 50/50 - enough that on more than one project I've made it a user preference.

stopAtEnd exists, so why *not* honor it for linearly manipulated controls?