|
|
|
@ -2348,12 +2348,11 @@ const workflowStoreImpl: StateCreator<WorkflowStore> = (set, get) => ({ |
|
|
|
if (nodesToGroup.length === 0) return ""; |
|
|
|
pushUndoCheckpoint(get, set); |
|
|
|
|
|
|
|
// Calculate bounding box of selected nodes
|
|
|
|
// Calculate bounding box from persisted style sizes.
|
|
|
|
const nodeById = new Map(nodes.map((node) => [node.id, node])); |
|
|
|
const absolutePositionByNodeId = new Map<string, XYPosition>(); |
|
|
|
let minX = Infinity, minY = Infinity, maxX = -Infinity, maxY = -Infinity; |
|
|
|
nodesToGroup.forEach((node) => { |
|
|
|
// Use measured dimensions (actual rendered size) first, then style, then type-specific defaults
|
|
|
|
const { width, height } = getNodeSize(node); |
|
|
|
const absolutePosition = getAbsoluteNodePosition(node, nodeById); |
|
|
|
absolutePositionByNodeId.set(node.id, absolutePosition); |
|
|
|
|