From 84a001720c344f993ff476b6f2ca30aae49dd578 Mon Sep 17 00:00:00 2001 From: Jonathan <34005131+JPPhoto@users.noreply.github.com> Date: Tue, 26 Dec 2023 07:07:46 -0600 Subject: [PATCH] Added back bounds check --- .../web/src/features/nodes/components/flow/Flow.tsx | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/invokeai/frontend/web/src/features/nodes/components/flow/Flow.tsx b/invokeai/frontend/web/src/features/nodes/components/flow/Flow.tsx index e11142b58b..d98d3131c0 100644 --- a/invokeai/frontend/web/src/features/nodes/components/flow/Flow.tsx +++ b/invokeai/frontend/web/src/features/nodes/components/flow/Flow.tsx @@ -157,11 +157,13 @@ export const Flow = () => { }, []); const onMouseMove = useCallback((event: MouseEvent) => { - 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