Compare commits

...

2 Commits

Author SHA1 Message Date
darshanr0107
13d9bfa474 chore: add changeset
on-behalf-of: @Mermaid-Chart <hello@mermaidchart.com>
2025-12-19 17:53:12 +05:30
darshanr0107
7a14a1ac40 fix: hexagon shape column span
on-behalf-of: @Mermaid-Chart <hello@mermaidchart.com>
2025-12-19 17:10:22 +05:30
3 changed files with 19 additions and 2 deletions

View File

@@ -0,0 +1,5 @@
---
'mermaid': patch
---
fix: Ensure block diagram hexagon blocks respect column spanning syntax

View File

@@ -404,6 +404,18 @@ describe('Block diagram', () => {
a
b
a --- b
`,
{}
);
});
it('BL32: hexagon shape block should span correctly', () => {
imgSnapshotTest(
`block-beta
columns 3
A1{{"Opening tag"}} space A3{{"Closing tag"}}
B1["&lt;tagname&gt;"] B2["content"] B3["&lt;/tagname&gt;"]
C{{"Element"}}:3
`,
{}
);

View File

@@ -96,9 +96,9 @@ const hexagon = async (parent, node) => {
);
const f = 4;
const h = bbox.height + node.padding;
const h = node.positioned ? node.height : bbox.height + node.padding;
const m = h / f;
const w = bbox.width + 2 * m + node.padding;
const w = node.positioned ? node.width : bbox.width + 2 * m + node.padding;
const points = [
{ x: m, y: 0 },
{ x: w - m, y: 0 },