mnogueron / react-easy-panzoom

Wrapper to enable pan and zoom features for any React component
MIT License
79 stars 17 forks source link

PanZoom with react-designer component #33

Open tiagoravache opened 4 years ago

tiagoravache commented 4 years ago

Hi,

I'm developing a tool for a software where i needed to made a version of react-designer(https://github.com/react-designer/react-designer) combined with panZoom, in the 'draw container' i put a background image to guide the user where they have to draw some shapes to highlight some areas of bakground, and it's works very well but, when zooming the draw container, the reference of points 'x' and 'y' of mouseClick got offset, resulting in a shape drawed in another position relation to background, i suppose that is necessary consider zoom in the transform matrix but i'm not sure how to, so could you explain to me the calculations you made on the transform matrix? After this i can work on implementation of this calculus that consider the relative position of the mouse pointer in the zoomed image. Or if exist some way to do that with some feature that PanZoom already have. If you need more information about this case, i'm glad to provide to you everithing you need to solve this situation. Thanks