2
0

🐛 (editor) Fix bug preventing user to manually zoom in / out

Closes #156
This commit is contained in:
Baptiste Arnaud
2022-11-06 10:21:20 +01:00
parent 6dd7bd9562
commit 1f44e8f31f
3 changed files with 30 additions and 12 deletions

View File

@ -179,20 +179,20 @@ export const Graph = ({
useEventListener('click', handleClick, editorContainerRef.current)
useEventListener('mousemove', handleMouseMove)
// eslint-disable-next-line react-hooks/exhaustive-deps
const zoomIn = useCallback(() => zoom(zoomButtonsScaleBlock), [])
// eslint-disable-next-line react-hooks/exhaustive-deps
const zoomOut = useCallback(() => zoom(-zoomButtonsScaleBlock), [])
const zoomIn = () => zoom(zoomButtonsScaleBlock)
const zoomOut = () => zoom(-zoomButtonsScaleBlock)
return (
<DraggableCore onDrag={onDrag} enableUserSelectHack={false}>
<Flex ref={graphContainerRef} position="relative" {...props}>
<ZoomButtons onZoomIn={zoomIn} onZoomOut={zoomOut} />
<ZoomButtons onZoomInClick={zoomIn} onZoomOutClick={zoomOut} />
<Flex
flex="1"
w="full"
h="full"
position="absolute"
data-testid="graph"
style={{
transform,
}}