camera
camera copied to clipboard
How to make camera zoom move to initial pointer location while zooming?
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?
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
See erdtool.com (currently on pause) .. uses code in this lib