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

animate and zoomWithWheel together doesn't work well #515

Closed
YanDevDe opened this issue Oct 1, 2020 · 2 comments
Closed

animate and zoomWithWheel together doesn't work well #515

YanDevDe opened this issue Oct 1, 2020 · 2 comments

Comments

@YanDevDe
Copy link

YanDevDe commented Oct 1, 2020

Describe the bug

Using {animate: true} as config and using zoomWithWheel will shift the position if you're scrolling very quickly.

Your environment

  • Version of panzoom: 4.3.2
  • Browser and browser version: Brave Browser Version 1.14.84 Chromium: 85.0.4183.121 (Official Build) (64-bit)

This issue also appears on Chrome as well.

Expected behavior

Smooth zoom with scrolling without shifting the position

Actual behavior

If shifts if you scroll very quickly.

Steps to reproduce

Add {animate: true} at Panzoom config and use wheel listener with .zoomWithWheel

Example

https://jsbin.com/lelujesece/1/edit?html,css,js,output

@timmywil
Copy link
Owner

timmywil commented Oct 1, 2020

Thanks for opening an issue. This has to do with the async nature of Panzoom. Best thing to do is not use animate when zooming with the mouse wheel.

@timmywil timmywil closed this as completed Oct 1, 2020
@tmladek
Copy link

tmladek commented Jan 9, 2021

Hi, I've ran into the same issue, it's a pity! Is there no other workaround?

Also, I am not entirely sure it is entirely about Panzoom being async; if I do not animate and simply zoom to a single point repeatedly, every once in a while, the (SVG) element seems to shift slightly, usually at fairly high zoom levels. Could this maybe be related?

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

3 participants