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

Pan to element in container #340

Open
Jasonvdlee opened this issue Jan 30, 2025 · 2 comments
Open

Pan to element in container #340

Jasonvdlee opened this issue Jan 30, 2025 · 2 comments

Comments

@Jasonvdlee
Copy link

Hello,

I simply want to utilize the instance.moveTo(x, y) function to center a specific element within the container of the screen. I have read that the x and y values depend on the current zoom level. Is that true? That would make things a little more difficult. I do have the position of the element within the container. I am just unsure what the panzoom library does exactly that could potentially affect the calculation I am making to determine the position of the element.

Tl;dr: I have an element in the panzoom container. How do I center it by panning to that position?

@Jasonvdlee
Copy link
Author

Thanks (AI), but that does not fix the issue. Now the image in my container shifts all the way to the left of my screen. I was expecting it to center the element in the center of the screen, but that is not the case.

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
@Jasonvdlee and others