Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Wierd behavior when zooming on the right side #196

Open
Benja0906 opened this issue May 19, 2020 · 3 comments
Open

Wierd behavior when zooming on the right side #196

Benja0906 opened this issue May 19, 2020 · 3 comments

Comments

@Benja0906
Copy link

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/

@rhuitl
Copy link

rhuitl commented May 29, 2020

@Benja0906 did you manage to fix it? I can't reproduce it on your example! We have the same problem in our implementation.

@Benja0906
Copy link
Author

@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.

@ghost
Copy link

ghost commented May 12, 2021

This line is the culprit:

if (!transformAdjusted) transform.scale *= ratio;

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants