react-quick-pinch-zoom icon indicating copy to clipboard operation
react-quick-pinch-zoom copied to clipboard

how could zoom in / zoom out when

Open caltamiranob opened this issue 4 years ago • 2 comments

@Hello, could you help me with this functionality:

When user press double tap my image scale to 2, next if the user press double tap again then my image scale to 1. There are some event o method to manage these funcionality.

I appreciate your support. Thank you

caltamiranob avatar Dec 29 '20 17:12 caltamiranob

I'm looking for the same thing - zoom in and out with a double tap.

I tried to do this with the scaleTo method but calling it from the onDoubleTap event breaks the animation logic - the updates are called but they all have a scale of 2 until the last update which has a scale of 1, this felt unresponsive and jerky.

In the end I found a hacky solution by tracking the current scale, setting enabled to false if the scale is max, listen for double tap / click events yourself on nested element and call scaleTo when triggered to zoom out - it works quite well.

8eecf0d2 avatar Mar 29 '21 22:03 8eecf0d2

In the end I found a hacky solution by tracking the current scale, setting enabled to false if the scale is max, listen for double tap / click events yourself on nested element and call scaleTo when triggered to zoom out - it works quite well.

@8eecf0d2 hey, would you mind sharing the code-snippet for it? I'm currently battling the same issue.

ummahusla avatar Feb 23 '22 11:02 ummahusla

you can try alternative library: https://github.com/prc5/react-zoom-pan-pinch

retyui avatar Oct 16 '22 09:10 retyui