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

How to make camera zoom move to initial pointer location while zooming? #8

Open
kapv89 opened this issue Jan 14, 2023 · 2 comments
Open

Comments

@kapv89
Copy link

kapv89 commented Jan 14, 2023

Hi, so I am using code from this in a project with an infinite canvas with multiple objects. The behaviour I'd like is that when zooming starts and the mouse pointer is over a certain object, that object moves to the center of the viewport as zoom progresses. Any idea how to achieve this?

@JuxtNorth
Copy link

You'd have to first detect whether the mouse pointer is above an object, then move the camera to that object's position using the moveTo function and then zoom in/out

@kapv89
Copy link
Author

kapv89 commented Feb 25, 2024

See erdtool.com (currently on pause) .. uses code in this lib

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