Wierd behavior when zooming on the right side
I,ve been trying to implement this amazing library on my website, and everything seems fine, until I try zoo zoom on the right side of the screen. It will randomly jump the vire or scroll the view instead, on the left side the scrolling works fine. It happens both on desktop, tablet and phone.
Here is a link to it, maybe somebody can find an obvious mistake, that I'm missing. https://www.worldinwood.se/installation/verdenskort_large/
@Benja0906 did you manage to fix it? I can't reproduce it on your example! We have the same problem in our implementation.
@rhuitl No, but I found a workaround that works for me, for now atleast. When wierd behavior happens when I have the bounds enabled and set to anything else than 1. So for for now I just set the bounds to 1, and it seems to be working fine for now.
This line is the culprit:
https://github.com/anvaka/panzoom/blob/0b42ea0bfb998e8008458bca66a6a7c24ce72f21/index.js#L413
It doesn't set the scale if it determines that the current view isn't in bounds, but it still applies the translation. In my case it pushes the view to the bottom right of the screen.
Getting rid of the conditional jolts the screen to within the bounds and applies the zoom, not ideal, but perhaps better than the current behavior.
Using the domController if that's relevant.