Zooming into a specific canvas point
See original GitHub issueHi,
I’m trying to setup zooming into a specific point on the paper. On mouse wheel event, when I scale using event provided coordinates:
paper.scale(scale, scale, x, y);
graph scales off target point.
Is this achievable using paper.prototype.scale() method, or should I be using a different approach?
JointJS@2.2.1
Thanks.
Issue Analytics
- State:
- Created 5 years ago
- Comments:6 (3 by maintainers)
Top Results From Across the Web
Zoom in on a point (using scale and translate) - Stack Overflow
The zoom point is simply the point in the old zoom and the new zoom that you want to remain the same. Which...
Read more >How to zoom in on a point using scale and translate
You are given a zoom in to particular image by using scale and translate ... If you scale a canvas, all future drawings...
Read more >Zoom in and out on the canvas using the Zoom tool
To zoom out, hold Alt and click the area or press Ctrl + 0 (Windows), hold Opt and click the area or press...
Read more >Zooming via HTML5 Canvas Context - Phrogz.net
Showing how to use transform methods on the HTML5 Canvas Context to selectively zoom in and out. Drag to pan. Click to zoom...
Read more >Creating a Zoom UI - Steve Ruiz
A zoom UI has two coordinate systems: screen coordinates and canvas coordinates. A certain point on the screen will always refer to a...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Doesn’t seem like an ideal solution, since this translates view-port to coordinate origin.
To anyone else wondering, I got my desired behavior like this:
I’ll be closing the issue.
Note that
joint.ui.PaperScroller
has the ready-made solution for this:https://resources.jointjs.com/docs/rappid/v2.4/ui.html#ui.PaperScroller