fix(PageComponent): change position calculation to use screenToFlowPosition instead of project to fix incorrect node creation position

This commit is contained in:
anovazzi1 2023-11-23 18:41:13 -03:00
commit 8e47e7c9d7

View file

@ -319,9 +319,9 @@ export default function Page({
);
// Calculate the position where the node should be created
const position = reactFlowInstance!.project({
x: event.clientX - reactflowBounds!.left,
y: event.clientY - reactflowBounds!.top,
const position = reactFlowInstance!.screenToFlowPosition({
x: event.clientX,
y: event.clientY
});
// Generate a unique node ID