Viewport scroll direction tolerances


#1

I’d like to add some tolerance for scroll directions in a viewport. i.e when scrolling up and down some forgiveness is given for slight side to side movement, and vice versa.

Is there a means to achieve this with the Viewport? I could try to manage it with the visible area changed callback, but that happens after the position update so I’m not sure it’s ideal.

Thanks.


#2

I assume this is for a mobile app and you are scrolling the viewport via dragging right?


#3

It is drag scrolling but actually on my laptop (mac) via the trackpad. My action is not perfectly angled (or consistent) and the viewport responds exactly to it, which exposes my clumsiness. Comparing it to say the Finder window, Apple seems to employ some tolerance and so it takes more effort to go off track.

If you’re on a mac, you can compare the scrolling behaviours between the JUCE table widget demo and a finder window. (both resized so that the content can scroll in both directions).