Skip to content

Commit 1b1612d

Browse files
committed
pinch example no longer resizing
1 parent bbe136f commit 1b1612d

1 file changed

Lines changed: 34 additions & 28 deletions

File tree

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

Lines changed: 34 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -97,34 +97,36 @@ export default function App() {
9797

9898
return (
9999
<GestureHandlerRootView>
100-
<View ref={containerRef} style={styles.container}>
101-
<GestureDetector gesture={pan}>
100+
<View style={styles.container}>
101+
<View style={styles.innerContainer} ref={containerRef}>
102+
<GestureDetector gesture={pan}>
103+
<Animated.View
104+
ref={boxRef}
105+
style={[styles.box, boxAnimatedStyles]}></Animated.View>
106+
</GestureDetector>
102107
<Animated.View
103-
ref={boxRef}
104-
style={[styles.box, boxAnimatedStyles]}></Animated.View>
105-
</GestureDetector>
106-
<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>
108+
style={[
109+
styles.dot,
110+
{
111+
transform: [
112+
{ translateX: pointerPositionX },
113+
{ translateY: pointerPositionY },
114+
],
115+
opacity: touchOpacity,
116+
},
117+
]}></Animated.View>
118+
<Animated.View
119+
style={[
120+
styles.dot,
121+
{
122+
transform: [
123+
{ translateX: negativePointerPositionX },
124+
{ translateY: negativePointerPositionY },
125+
],
126+
opacity: touchOpacity,
127+
},
128+
]}></Animated.View>
129+
</View>
128130
</View>
129131
</GestureHandlerRootView>
130132
);
@@ -135,7 +137,11 @@ const styles = StyleSheet.create({
135137
flex: 1,
136138
alignItems: 'center',
137139
justifyContent: 'center',
138-
aspectRatio: 3,
140+
},
141+
innerContainer: {
142+
height: 100,
143+
justifyContent: 'center',
144+
alignItems: 'center',
139145
},
140146
box: {
141147
aspectRatio: 1,

0 commit comments

Comments
 (0)