As you said, snapping to a fixed position is easy, and can be made to work with mouse, touch or keyboard :
Snapping with keyboard or tap + interpolation is also pretty trivial:
Now, snapping with a mouse drag/touch + interpolation is an order of magnitude more complicated all of a sudden because you’re constantly overriding the value of the slider while the interpolation is trying to do its magic. That’s how the slider works, unfortunately.
I believe it would be easier to write your own slider rather than trying to wrestle with the existing one. 2 images placed in a canvas should do the trick.
- you’d want to set it up in such a way, that you actually do not drag the handle at all but create a consecutive snapping point based on the mouse movement direction and mouse position within the widget
- mouse position within the widget (SnappedToGrid) can be obtained by converting absolute mouse position to local widget geometry
- “drag” direction can be extracted from mouse delta
It should/could work, is untested but might be worth exploring.
If I ever figure out an easy way to do it, I’ll try to post it here. Or perhaps someone else will beat me to it.