reaviz / reaflow

🎯 React library for building workflow editors, flow charts and diagrams. Maintained by @goodcodeus.
https://reaflow.dev
Apache License 2.0
2.15k stars 123 forks source link

Zooming #3

Open amcdnl opened 4 years ago

amcdnl commented 4 years ago

Add ability to:

Should use react-use-gestures

ASchwad commented 3 years ago

Hi @amcdnl, do I understand correctly, that the only open point regarding the zoom is the task " Zoom should center on mouse/pinch center" ? I get some weird behaviour when zooming, as if the maxZoom and minZoom are not enforced. So if i zoom out, the zoom wil be capped at the zoomMax, but when i zoom back in i have to scroll in the "excess" before actually seeing a change in the zoom. Also, there seems to be some scaling in scrolling fast or slow. This is happening for me in any storybook story in Firefox and Chrome. Any idea where to start with these issues?

amcdnl commented 3 years ago

@ASchwad - The issue is that it should zoom the point on the matrix of your mouse cursors position.

I've also encountered some odd behavior w/ zooming but seems to work overall fine so haven't dug in too much.

amcdnl commented 3 years ago

Here is an example of what I'm talking about: https://github.com/anvaka/panzoom#fixed-transform-origin-when-zooming