naver / egjs-conveyer

Conveyer adds Drag gestures to your Native Scroll.
https://naver.github.io/egjs-conveyer/
MIT License
111 stars 8 forks source link

fix: fix scroll methods moving to invalid position #53

Closed malangfox closed 11 months ago

malangfox commented 11 months ago

Issue

52

Details

https://codepen.io/malangfox/pen/bGOqJKE If you zoom in to 125% and press the NEXT button multiple times, it malfunctions at the end.

This is related to the animation that occurs during the axes.setBy in scroll methods.

When the animation runs, an integer value is added to the scroll position based on the elapsed time, but this integer value is converted to a decimal value at scrollLeft, scrollTop when the browser's zoom changes.

You can check this link and this link that the scroll value is converted to a decimal value related to the browser's zoom.

As a result, the problem of mixing decimal values in the math causes the method to reach an incorrect destination.

My approach to this issue was as follows.