Added back bounds check

This commit is contained in:
Jonathan 2023-12-26 07:07:46 -06:00 committed by psychedelicious
parent c9951cd86b
commit 84a001720c

View File

@ -157,11 +157,13 @@ export const Flow = () => {
}, []); }, []);
const onMouseMove = useCallback((event: MouseEvent<HTMLDivElement>) => { const onMouseMove = useCallback((event: MouseEvent<HTMLDivElement>) => {
const pos = $flow.get()?.screenToFlowPosition({ if (flowWrapper.current?.getBoundingClientRect()) {
x: event.clientX, const pos = $flow.get()?.screenToFlowPosition({
y: event.clientY, x: event.clientX,
}); y: event.clientY,
cursorPosition.current = pos; });
cursorPosition.current = pos;
}
}, []); }, []);
// #region Updatable Edges // #region Updatable Edges