File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -125,9 +125,12 @@ const Pinchy = ({uuid}: {uuid: string}) => {
125125
126126 const renderedImageSize = useRef ( { imageWidth : 0 , imageHeight : 0 } ) ;
127127
128+ const [ isZoomed , setIsZoomed ] = useState ( false ) ;
129+
128130 const setScale = ( s : number ) => {
129131 scale . current = s ;
130132 animatedScale . current . setValue ( s ) ;
133+ setIsZoomed ( s > 1 + 1e-5 ) ;
131134 } ;
132135
133136 const setPosition = ( p : { x : number , y : number } ) => {
@@ -164,6 +167,7 @@ const Pinchy = ({uuid}: {uuid: string}) => {
164167 const pan = useMemo (
165168 ( ) => Gesture . Pan ( )
166169 . runOnJS ( true )
170+ . enabled ( isZoomed )
167171 . onStart ( ( ) => {
168172 positionBase . current = { ...position . current } ;
169173 } )
@@ -181,7 +185,7 @@ const Pinchy = ({uuid}: {uuid: string}) => {
181185 . onEnd ( ( ) => {
182186 positionBase . current = null ;
183187 } ) ,
184- [ ] ,
188+ [ isZoomed ] ,
185189 ) ;
186190
187191 const pinch = useMemo (
You can’t perform that action at this time.
0 commit comments