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