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>) => {
if (flowWrapper.current?.getBoundingClientRect()) {
const pos = $flow.get()?.screenToFlowPosition({ const pos = $flow.get()?.screenToFlowPosition({
x: event.clientX, x: event.clientX,
y: event.clientY, y: event.clientY,
}); });
cursorPosition.current = pos; cursorPosition.current = pos;
}
}, []); }, []);
// #region Updatable Edges // #region Updatable Edges