Skip to content

Commit 8dc5f01

Browse files
committed
pinch example no longer resizing in v2
1 parent 1b1612d commit 8dc5f01

1 file changed

Lines changed: 33 additions & 26 deletions

File tree

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

Lines changed: 33 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -97,33 +97,35 @@ export default function App() {
9797
return (
9898
<GestureHandlerRootView>
9999
<View ref={containerRef} style={styles.container}>
100-
<GestureDetector gesture={pan}>
100+
<View style={styles.innerContainer}>
101+
<GestureDetector gesture={pan}>
102+
<Animated.View
103+
ref={boxRef}
104+
style={[styles.box, boxAnimatedStyles]}></Animated.View>
105+
</GestureDetector>
101106
<Animated.View
102-
ref={boxRef}
103-
style={[styles.box, boxAnimatedStyles]}></Animated.View>
104-
</GestureDetector>
105-
<Animated.View
106-
style={[
107-
styles.dot,
108-
{
109-
transform: [
110-
{ translateX: pointerPositionX },
111-
{ translateY: pointerPositionY },
112-
],
113-
opacity: touchOpacity,
114-
},
115-
]}></Animated.View>
116-
<Animated.View
117-
style={[
118-
styles.dot,
119-
{
120-
transform: [
121-
{ translateX: negativePointerPositionX },
122-
{ translateY: negativePointerPositionY },
123-
],
124-
opacity: touchOpacity,
125-
},
126-
]}></Animated.View>
107+
style={[
108+
styles.dot,
109+
{
110+
transform: [
111+
{ translateX: pointerPositionX },
112+
{ translateY: pointerPositionY },
113+
],
114+
opacity: touchOpacity,
115+
},
116+
]}></Animated.View>
117+
<Animated.View
118+
style={[
119+
styles.dot,
120+
{
121+
transform: [
122+
{ translateX: negativePointerPositionX },
123+
{ translateY: negativePointerPositionY },
124+
],
125+
opacity: touchOpacity,
126+
},
127+
]}></Animated.View>
128+
</View>
127129
</View>
128130
</GestureHandlerRootView>
129131
);
@@ -141,6 +143,11 @@ const styles = StyleSheet.create({
141143
backgroundColor: '#b58df1',
142144
cursor: 'pointer',
143145
},
146+
innerContainer: {
147+
height: 100,
148+
justifyContent: 'center',
149+
alignItems: 'center',
150+
},
144151
dot: {
145152
width: 24,
146153
height: 24,

0 commit comments

Comments
 (0)