mirror of
https://github.com/invoke-ai/InvokeAI
synced 2024-08-30 20:32:17 +00:00
Eliminate constant console deprecation warnings
React Flow 11.10 eliminates the need to use project() and issues a deprecation warning to the console every time that onMouseMove is called (see https://reactflow.dev/whats-new/2023-11-10#rename-usereactflowproject-to-usereactflowscreentoflowposition). This code change eliminates that warning,
This commit is contained in:
parent
83a9e26cd8
commit
c9951cd86b
@ -157,14 +157,11 @@ export const Flow = () => {
|
|||||||
}, []);
|
}, []);
|
||||||
|
|
||||||
const onMouseMove = useCallback((event: MouseEvent<HTMLDivElement>) => {
|
const onMouseMove = useCallback((event: MouseEvent<HTMLDivElement>) => {
|
||||||
const bounds = flowWrapper.current?.getBoundingClientRect();
|
const pos = $flow.get()?.screenToFlowPosition({
|
||||||
if (bounds) {
|
x: event.clientX,
|
||||||
const pos = $flow.get()?.project({
|
y: event.clientY,
|
||||||
x: event.clientX - bounds.left,
|
});
|
||||||
y: event.clientY - bounds.top,
|
cursorPosition.current = pos;
|
||||||
});
|
|
||||||
cursorPosition.current = pos;
|
|
||||||
}
|
|
||||||
}, []);
|
}, []);
|
||||||
|
|
||||||
// #region Updatable Edges
|
// #region Updatable Edges
|
||||||
|
Loading…
x
Reference in New Issue
Block a user