Browse Source

备注修改

feature/071
yun 1 week ago
parent
commit
225d45fc14
  1. 1
      src/components/__tests__/OutputNode.test.tsx
  2. 3
      src/store/workflowStore.ts

1
src/components/__tests__/OutputNode.test.tsx

@ -69,6 +69,7 @@ describe("OutputNode", () => {
regenerateNode: vi.fn(),
edges: [],
isRunning: false,
runningNodeIds: new Set<string>(),
currentNodeIds: [],
groups: {},
nodes: [],

3
src/store/workflowStore.ts

@ -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);

Loading…
Cancel
Save