Skip to content

Commit 75d8e72

Browse files
committed
fixed scroll bug with pinch example
1 parent 9afe89f commit 75d8e72

2 files changed

Lines changed: 4 additions & 4 deletions

File tree

packages/docs-gesture-handler/static/examples/PinchGestureBasic.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ export default function App() {
4444
containerRef.current.measureInWindow((x, y, w, h) => {
4545
maxBoxSize.value = Math.min(w, h);
4646

47-
boxWidth.value = maxBoxSize.value / 2;
47+
boxWidth.value = clamp(boxWidth.value, minBoxSize, maxBoxSize.value);
4848
});
4949
}
5050
}
@@ -97,8 +97,8 @@ export default function App() {
9797
}));
9898

9999
return (
100-
<GestureHandlerRootView>
101-
<View ref={containerRef} style={styles.container}>
100+
<GestureHandlerRootView >
101+
<View ref={containerRef} style={[styles.container]}>
102102
<GestureDetector gesture={pan}>
103103
<Animated.View
104104
ref={boxRef}

packages/docs-gesture-handler/versioned_docs/version-2.x/examples/PinchGestureBasic.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ export default function App() {
4444
containerRef.current.measureInWindow((x, y, w, h) => {
4545
maxBoxSize.value = Math.min(w, h);
4646

47-
boxWidth.value = maxBoxSize.value / 2;
47+
boxWidth.value = clamp(boxWidth.value, minBoxSize, maxBoxSize.value);
4848
});
4949
}
5050
}

0 commit comments

Comments
 (0)