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

Resize a big image breaks its positioning #677

Open
epikgit opened this issue Jan 29, 2025 · 0 comments
Open

Resize a big image breaks its positioning #677

epikgit opened this issue Jan 29, 2025 · 0 comments

Comments

@epikgit
Copy link

epikgit commented Jan 29, 2025

Describe the bug

I've got an svg image positioned inside a div whose height is smaller.
I have to load the svg inside the div and show it otherwise panzoom is not able to process it. But since I put a big image inside the div, this one increases its virtual height and y scrollbar appears.
Not a problem anyway.
Now I'm trying to resize the image to fit the height in the viewport but when I use the zoom command something strange happens: the starting point of my image is no longer on y=0 but it's centered in the container.
I tried everything to move the image to the y=0 coordinate but nothing works.
It seems that I have to use the pan command with negative value on y (????).
So I thought that a new focal positioned to 0,0 instead of 50%,50% could work but nothing.
I tried to change the start points (again on 0,0) but nothing.
Is there a bug here?
It seems very similar to issue #672 even if the problem is with the manual zooming, not with the relative command.

Your environment

  • Version of panzoom: 4.6.0
  • Browser and browser version: any browser (Chrome, Edge, FF, Opera...)

Expected behavior

When I dwarf an image I should be able to set the focal point where the zoom needs to base its process.
Or my panning coordinates shouldn't be affected by the zoom.
Best should be if I could zoom something before loading on the DOM so I can put it where I want.

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