diff --git a/packages/core/src/graphs/graph/graph.ts b/packages/core/src/graphs/graph/graph.ts index 2c0a0e45..ef3c6b54 100644 --- a/packages/core/src/graphs/graph/graph.ts +++ b/packages/core/src/graphs/graph/graph.ts @@ -359,8 +359,11 @@ export class Graph { static dMove(graphs: Graph[], dx: number, dy: number) { for (const graph of graphs) { - graph.attrs.x += dx; - graph.attrs.y += dy; + const bbox = graph.getBBox(); + graph.updateAttrs({ + x: bbox.x + dx, + y: bbox.y + dy, + }); } }