There's nothing wrong with that expression. If your ranges/size cause it to do something you don't want, then you'll need to change your ranges or size to something more suitable.
Can you explain why that requirement is imposed for velocity drag? Unless I'm misunderstanding something, I believe our range, min/max, interval are all reasonable.
A related question: is toggling the velocity/absolute drag mode during a drag gesture unsupported? We're used to being able to switch between three drag modes (fine, standard, coarse; selected by mouse modifiers) on the fly in our existing plugins, but doing so in juce causes the slider/mouse to jump erratically.
Sorry, I see what you mean. The point of that test is to avoid using relative mode if absolute mode would already provide all the accuracy that's needed to set any legal value for the slider. That's probably a good choice for the user, because it makes it easier, but I guess that if you want a consistent experience it's not ideal..
And yes, it'd certainly be very difficult to toggle the mode while it's dragging, as there's a bunch of state that gets created when the drag starts, which would cause some complication if the mode randomly changes.
Thanks, that makes sense. Is there a way to manually trigger a drag stop/start when we know the mouse modifier has changed? Or alternatively, can you recommend any approaches for dupilcating our existing mouse handling? We actually don't really want a velocity mode for the fine control, but rather, a mode in which a slider movement requires something like ~5x mouse movement.
It might just be worth writing your own version if you need something that specific - it wouldn't be hard to just override the mouse callbacks and implement some other kind of mapping.