diff --git a/packages/mermaid/src/diagrams/block/layout.ts b/packages/mermaid/src/diagrams/block/layout.ts index a9d32d2d2..b16b9971e 100644 --- a/packages/mermaid/src/diagrams/block/layout.ts +++ b/packages/mermaid/src/diagrams/block/layout.ts @@ -122,7 +122,10 @@ function setBlockSizes(block: Block, db: BlockDB, siblingWidth = 0, siblingHeigh } const columns = block.columns || -1; - const numItems = block.children.length; + let numItems = 0; + for (const child of block.children) { + numItems += child.widthInColumns || 1; + } // The width and height in number blocks let xSize = block.children.length;