Skip to content

Commit e30cddb

Browse files
authored
fix pinch not working sometimes (#28836)
1 parent ff32879 commit e30cddb

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

shared/patches/react-native-zoom-toolkit+5.0.1.patch

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,3 +11,16 @@ index 4f8f019..10d5c10 100644
1111

1212
const { x, y } = pinchTransform({
1313
toScale: toScale,
14+
diff --git a/node_modules/react-native-zoom-toolkit/src/commons/hooks/usePinchCommons.ts b/node_modules/react-native-zoom-toolkit/src/commons/hooks/usePinchCommons.ts
15+
index 617862f..38ae47c 100644
16+
--- a/node_modules/react-native-zoom-toolkit/src/commons/hooks/usePinchCommons.ts
17+
+++ b/node_modules/react-native-zoom-toolkit/src/commons/hooks/usePinchCommons.ts
18+
@@ -170,7 +170,7 @@ export const usePinchCommons = (options: PinchOptions) => {
19+
translate.x.value = withTiming(toX);
20+
translate.y.value = withTiming(toY);
21+
scale.value = withTiming(toScale, undefined, (finished) => {
22+
- scaleOffset.value = scale.value;
23+
+ //scaleOffset.value = scale.value;
24+
finished && runOnJS(switchGesturesState)(true);
25+
});
26+

0 commit comments

Comments
 (0)