mrjs icon indicating copy to clipboard operation
mrjs copied to clipboard

Add momentum scrolling and rubber-banding when scrolling

Open lobau opened this issue 2 years ago • 1 comments

When scrolling in XR with your hand, the scrolling stops instantly when you release your mouse, and abruptly when you reach the beginning and the end of the scrollview. I suggest we implement momentum scroll and rubber-banding to our scollviews.

Momentum scrolling: If you touch down, flick, and release, the content should coast for a bit before stopping. Rubber banding: when reaching the beginning and the end of the scroll-view (top / bottom, left / right, or both), you should feel some resistance, like a rubber band. If you pull and release, it should naturally snap back.

Here is an example of implementation https://idiotwu.github.io/smooth-scrollbar/ Another example: https://codepen.io/popmotion/pen/BMNvqj

lobau avatar Nov 18 '23 00:11 lobau

More math / browser data here https://github.com/revery-ui/revery/issues/288

lobau avatar Nov 18 '23 00:11 lobau