mirror of
https://github.com/invoke-ai/InvokeAI
synced 2024-08-30 20:32:17 +00:00
Update useBuildNode.ts
Added addition of the rect's top left coordinates to get equivalent behavior.
This commit is contained in:
parent
84a001720c
commit
f6664960ca
@ -38,11 +38,11 @@ export const useBuildNode = () => {
|
|||||||
?.getBoundingClientRect();
|
?.getBoundingClientRect();
|
||||||
|
|
||||||
if (rect) {
|
if (rect) {
|
||||||
_x = rect.width / 2 - NODE_WIDTH / 2;
|
_x = rect.width / 2 - NODE_WIDTH / 2 + rect.left;
|
||||||
_y = rect.height / 2 - NODE_WIDTH / 2;
|
_y = rect.height / 2 - NODE_WIDTH / 2 + rect.top;
|
||||||
}
|
}
|
||||||
|
|
||||||
const position = flow.project({
|
const position = flow.screenToFlowPosition({
|
||||||
x: _x,
|
x: _x,
|
||||||
y: _y,
|
y: _y,
|
||||||
});
|
});
|
||||||
|
Loading…
Reference in New Issue
Block a user