reaflow
reaflow copied to clipboard
Zooming
Add ability to:
- [x] Zoom In
- [x] Zoom Out
- [x] Fit into View
- [x] Zoom Programmatically through ref
- [x] Fit view on load
- [x] Pinch to zoom
- [x] CTRL+Mouse Wheel to zoom
- [ ] Zoom should center on mouse/pinch center
Should use react-use-gestures
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?
@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.
Here is an example of what I'm talking about: https://github.com/anvaka/panzoom#fixed-transform-origin-when-zooming