I am currently using this module: https://github.com/mxmzb/react-native-gesture-detector. I want to be able to draw a line from the points created. however, it only seems to output circles.
It has a "Create Gesture" view:
<View style={{ position: "relative", width: "100%", height: "100%" }}>
<GesturePath
path={gesture.map(coordinate => {
if (recorderOffset) {
return {
x: coordinate.x + recorderOffset.x,
y: coordinate.y + recorderOffset.y,
};
}
return coordinate;
})}
color="green"
slopRadius={30}
center={false}
/>
</View>
GesturePath is defined like so:
const GesturePath = ({ path, color, slopRadius, center = true }: GesturePathProps) => {
const baseStyle: ViewStyle = {
position: "absolute",
top: center ? "50%" : 0,
left: center ? "50%" : 0,
opacity: 1,
};
return (
<>
{path.map((point, index) => (
<Animated.View
style={Object.assign({}, baseStyle, {
width: slopRadius,
height: slopRadius,
borderRadius: slopRadius,
backgroundColor: color,
marginLeft: point.x - slopRadius,
marginTop: point.y - slopRadius,
})}
key={index}
/>
))}
</>
);
};
When you draw on that view, it outlines the path using dots, like so:
I would like it to be a smooth line and not a series of circles that the above image.