SpyrexDE / SmoothScroll

Addon for the Godot Game Engine that adds a SmoothScrollContainer.
https://spyrexde.github.io/SmoothScroll/
MIT License
132 stars 10 forks source link

Scrollcontainer overdrags too far on fast mouse movement #27

Closed SpyrexDE closed 9 months ago

SpyrexDE commented 1 year ago

overdragBack The issue only exists when the mouse is moved fast enough.

HaroldLever commented 1 year ago

I might have found where the problem is.

For example, assuming damping=0.1, at frame 1 you drag down 50 pixel, the formular calculate with "distance=0", resulting 50, however at frame 2 you drag up -50 pixel, the formular calculate with "distance=50" from last frame, resulting -8.33, way more less to drag back.

I'm afraid handle_content_dragging() function should be refactored totally, sadly I haven't come up with any idea yet. Do you have any good idea?