camera icon indicating copy to clipboard operation
camera copied to clipboard

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

Open kapv89 opened this issue 2 years ago • 2 comments

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?

kapv89 avatar Jan 14 '23 08:01 kapv89

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

JuxtNorth avatar Jun 22 '23 06:06 JuxtNorth

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

kapv89 avatar Feb 25 '24 13:02 kapv89