From f9eab533bae9f5daba3726a3c095aebc78428e2b Mon Sep 17 00:00:00 2001 From: corpulent Date: Thu, 28 Jul 2022 18:53:45 +0300 Subject: [PATCH] fix: proper node position on create --- services/frontend/src/components/Project/index.tsx | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/services/frontend/src/components/Project/index.tsx b/services/frontend/src/components/Project/index.tsx index 43b9e34..25b6d10 100644 --- a/services/frontend/src/components/Project/index.tsx +++ b/services/frontend/src/components/Project/index.tsx @@ -231,7 +231,10 @@ export default function Project() { values, ensure(sections.find((l) => l.type === values.type)) ); - clientNodeItem.position = { left: 60, top: 30 }; + clientNodeItem.position = { + left: 60 - canvasPosition.left, + top: 30 - canvasPosition.top + }; setNodes({ ...nodes, [clientNodeItem.key]: clientNodeItem }); };