Replies: 1 comment
-
Any updates? |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I've boiled the issue I'm having down to cancelling happening on the canvas. It works wherever the canvas isn't on that View or (Animated.View). The even is CANCELLED after BEGAN. It's like the canvas is robbing the event from RNGH, but I can't identify any information further or how to take it back.
Any ideas where to go from here? I want to be able to pinch to zoom on the canvas.
code as follows:
`import React, { useRef } from 'react';
import { StyleSheet, View, Animated } from 'react-native';
import { Canvas } from 'react-three-fiber';
import {
PinchGestureHandler,
State,
} from "react-native-gesture-handler";
export function App() {
const pinchRef = useRef();
_onPinchGestureEvent = (e) => {
console.log("Scale: " + e.nativeEvent.scale)
}
_onPinchHandlerStateChange = (e) => {
if (e.nativeEvent.state === State.END) console.log("END")
if (e.nativeEvent.state === State.UNDETERMINED) console.log("UNDETERMINED")
if (e.nativeEvent.state === State.CANCELLED) {
console.log("CANCELLED")
//console.log(e.nativeEvent)
}
if (e.nativeEvent.state === State.FAILED) {
console.log("FAILED")
//console.log(e.nativeEvent)
}
if (e.nativeEvent.state === State.ACTIVE) console.log("ACTIVE")
if (e.nativeEvent.state === State.BEGAN) console.log("BEGAN")
};
return (
<Animated.View style={styles.pinchview}>
</Animated.View>
);
}
export default App;
const styles = StyleSheet.create({
pinchview: {
...StyleSheet.absoluteFillObject,
backgroundColor: 'transparent',
overflow: 'hidden',
alignItems: 'center',
flex: 1,
justifyContent: 'center',
},
canvas: {
backgroundColor: "red",
width: '50%',
height: '10%',
//opacity: 0, still blocks pinch events interestingly
}
});`
Beta Was this translation helpful? Give feedback.
All reactions