From 225d45fc14605409b5bdf387271b1d0e16b9f358 Mon Sep 17 00:00:00 2001 From: yun Date: Mon, 6 Jul 2026 16:54:45 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A4=87=E6=B3=A8=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/__tests__/OutputNode.test.tsx | 1 + src/store/workflowStore.ts | 3 +-- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/components/__tests__/OutputNode.test.tsx b/src/components/__tests__/OutputNode.test.tsx index 6a70a6b7..e6a3b664 100644 --- a/src/components/__tests__/OutputNode.test.tsx +++ b/src/components/__tests__/OutputNode.test.tsx @@ -69,6 +69,7 @@ describe("OutputNode", () => { regenerateNode: vi.fn(), edges: [], isRunning: false, + runningNodeIds: new Set(), currentNodeIds: [], groups: {}, nodes: [], diff --git a/src/store/workflowStore.ts b/src/store/workflowStore.ts index 81115520..723a52c5 100644 --- a/src/store/workflowStore.ts +++ b/src/store/workflowStore.ts @@ -2348,12 +2348,11 @@ const workflowStoreImpl: StateCreator = (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(); 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);