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

Zoom factor reset to current zoom level after calling resize() #462

Open
enspritz opened this issue Jan 22, 2025 · 1 comment
Open

Zoom factor reset to current zoom level after calling resize() #462

enspritz opened this issue Jan 22, 2025 · 1 comment

Comments

@enspritz
Copy link

Maybe I'm using it wrong, but...

Reproduction steps:

  1. i.e. bring up a demo tiger SVG image.
  2. With you input devices, zoom in on the tiger to something definitely > 1x. Also, before or after, manipulate the DOM container of the tiger SVG to change its width/height.
  3. At the JS console, effect the resize:
svgPanZoom.resize()
  1. Attempt to zoom out. Turns out that the current zoom level seems to in effect be reset to 1x, and you can now zoom in and out as though starting fresh, except on a zoomed-in image.

In particular, the user is now able to zoom beyond configured maxZoom. This might also be the case for minZoom.

@enspritz
Copy link
Author

My current workaround is to call .resetZoom() prior to .resize(). This will surprise users, but is less surprising than not being able zoom back to 1x after a resize event, such as by simply rotating their device.

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

1 participant