anvaka / panzoom

Universal pan and zoom library (DOM, SVG, Custom)
https://anvaka.github.io/panzoom/demo/attach-via-script.html
MIT License
1.78k stars 285 forks source link

Race condition when controlling via zoomTo / smoothZoom methods #88

Open moltar opened 5 years ago

moltar commented 5 years ago

First pass I did while slowly clicking "zoom out" button. This works fine.

But if I click zoom out button rapidly, then some kind of jumping behavior can be seen.

I think maybe it's a race condition, where the first zoom out animation didn't finish yet, and the second one has started.

Demo video: http://take.ms/PpfAC

anvaka commented 5 years ago

Just to clarify, you are using smoothZoom(), correct?

moltar commented 5 years ago

Actually both give the same result if you click fast enough.

anvaka commented 5 years ago

I'm sorry, not sure I fully understand your comment. Which function do you use to zoom in?

moltar commented 5 years ago

Yes, smoothZoom.

rbonomo commented 5 years ago

Maybe related https://github.com/anvaka/panzoom/issues/99