From de8928b2d92e1684691682d339e2e17700939275 Mon Sep 17 00:00:00 2001 From: Knut Sveidqvist Date: Fri, 20 Jan 2023 12:48:06 +0100 Subject: [PATCH] #4016 Fix for max_sections in mindmap renderer --- packages/mermaid-mindmap/src/svgDraw.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/mermaid-mindmap/src/svgDraw.js b/packages/mermaid-mindmap/src/svgDraw.js index e4a52ad98..79eab6e1d 100644 --- a/packages/mermaid-mindmap/src/svgDraw.js +++ b/packages/mermaid-mindmap/src/svgDraw.js @@ -203,7 +203,7 @@ const roundedRectBkg = function (elem, node) { * @returns {number} The height nodes dom element */ export const drawNode = function (elem, node, fullSection, conf) { - const section = fullSection % MAX_SECTIONS; + const section = fullSection % (MAX_SECTIONS - 1); const nodeElem = elem.append('g'); node.section = section; nodeElem.attr( @@ -303,7 +303,7 @@ export const drawNode = function (elem, node, fullSection, conf) { }; export const drawEdge = function drawEdge(edgesElem, mindmap, parent, depth, fullSection) { - const section = (fullSection % MAX_SECTIONS) - 1; + const section = fullSection % (MAX_SECTIONS - 1); const sx = parent.x + parent.width / 2; const sy = parent.y + parent.height / 2; const ex = mindmap.x + mindmap.width / 2;