Closed Blindman139 closed 11 months ago
@Blindman139 could you please create a demo ? https://codesandbox.io/s/new
@retyui Find demo below https://codesandbox.io/s/react-quick-pinch-zoom-problem-3omjtb?file=/src/App.js Zooming will initiate after 2 sec so we can see effects, I have implemented same setup and css that I am using. I try changing container size using developer tools of google chrome.
Hi, It seems to be issue due to _initialZoomFactor. Need to adjust target co-ordinates before scaling. Is PR allowed?
Is PR allowed?
yes, your welcome
Hi @retyui,
Please visit PR - https://github.com/retyui/react-quick-pinch-zoom/pull/82 for improved demo and explanation.
good job! thanks you
Thanks for such a good library!!! I completely solved my problem until I faced this...
It seems that alignCenter method doesn't work the same way with all different sizes of container div. Suppose you have an image with size = 5000 x 5000, container div with size = 1000 x 1000 Now if I call alignCenter({x: 2000, y: 2000, scale: 5}) it should center image so that container div's center snaps on image's (2000, 2000) point in px. Now if I change container div size to 900 x 400, still result should be the same. But it isn't !!!
To reproduce the issue try changing container div's size by using developer mode and Dimension: Responsive for google chrome browser. No need to set container size and image size as above. Those are just numbers. Key is to change container !!!