diff --git a/packages/mermaid/src/diagrams/block/layout.ts b/packages/mermaid/src/diagrams/block/layout.ts index 7f44a5f19f..53e60a6977 100644 --- a/packages/mermaid/src/diagrams/block/layout.ts +++ b/packages/mermaid/src/diagrams/block/layout.ts @@ -61,7 +61,7 @@ const getMaxChildSize = (block: Block) => { continue; } if (width > maxWidth) { - maxWidth = width / (block.widthInColumns ?? 1); + maxWidth = width / (child.widthInColumns ?? 1); } if (height > maxHeight) { maxHeight = height;