Skip to content

Commit

Permalink
fix group manual positioning
Browse files Browse the repository at this point in the history
  • Loading branch information
fechan committed May 27, 2024
1 parent 1ca54d5 commit 3b11661
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions client/src/GraphUpdateCallbacks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ function onNodeDragStop(
}

clearDropTarget();
} else if (draggedNode.type === "machine" || draggedNode.type === "group") {
} else if (draggedNode.type === "machine" || draggedNode.type === "slot-group") {
// update node x/y

let nodeEditReq: MachineEditReq | GroupEditReq;
Expand All @@ -176,15 +176,14 @@ function onNodeDragStop(
y: draggedNode.position.y,
}
};
} else if (draggedNode.type === "group") {
const parentPos = reactFlowInstance.getNode(draggedNode.parentId!)!.position;
} else if (draggedNode.type === "slot-group") {
nodeEditReq = {
type: "GroupEdit",
reqId: uuidv4(),
groupId: draggedNode.id,
edits: {
x: parentPos.x - draggedNode.position.x,
y: parentPos.y - draggedNode.position.y,
x: draggedNode.position.x,
y: draggedNode.position.y,
}
}
}
Expand Down

0 comments on commit 3b11661

Please sign in to comment.