You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I was thinking about adding the inertia effect when panning the SVG.
By Inertia effect I mean that after we are done panning, the pan continues for a few milliseconds at a slower (ideally decreasing) speed.
If you are wondering how it would look like, check on Google Map, they use this effect when panning.
I'm not quite sure how to achieve that.
Maybe if there were a afterPan function, but I don't really see how to get the speed of the mouse (unless we just check the time and the distance between the 2 clicks that triggered the pan.)
Or maybe by calling panBy after each pan but the direction of the pan is also needed.
The text was updated successfully, but these errors were encountered:
Currently there is no such functionality and there is no plan for that.
It can be an idea for a plugin as per #98 but someone has to build that.
You could do that by listening for onPan callbacks, but it will not give you any information about when pan ended (as user may still hold the click even if he is not moving the mouse).
A solution would be to handle mouse events by yourself (as in [custom events](Custom events example)). There you'll have to compute by yourself velocity and direction of drag. After mouseup/touchend you'll have to call pan/panBy as long as you want your inertia to execute.
Hello,
I was thinking about adding the inertia effect when panning the SVG.
By Inertia effect I mean that after we are done panning, the pan continues for a few milliseconds at a slower (ideally decreasing) speed.
If you are wondering how it would look like, check on Google Map, they use this effect when panning.
I'm not quite sure how to achieve that.
Maybe if there were a
afterPan
function, but I don't really see how to get the speed of the mouse (unless we just check the time and the distance between the 2 clicks that triggered the pan.)Or maybe by calling
panBy
after eachpan
but the direction of the pan is also needed.The text was updated successfully, but these errors were encountered: