diff --git a/squarenotsquare/src/components/ScrollingPicker.js b/squarenotsquare/src/components/ScrollingPicker.js index 8122f33..624d7de 100644 --- a/squarenotsquare/src/components/ScrollingPicker.js +++ b/squarenotsquare/src/components/ScrollingPicker.js @@ -14,9 +14,10 @@ function ScrollingPicker(props) { const scrollX = useRef(new Animated.Value(0)).current; function onScroll(event){ - if (event.nativeEvent.contentOffset.x === 0) { + let rounded = Math.round(event.nativeEvent.contentOffset.x); + if (rounded === 0) { props.modeSetter('square'); - } else if (event.nativeEvent.contentOffset.x === (Metrics.icons.buttonIcon * 2)) { + } else if (rounded === (Metrics.icons.buttonIcon * 2)) { props.modeSetter('addition'); } Animated.event([