#4016 Fix for max_sections in mindmap renderer

This commit is contained in:
Knut Sveidqvist 2023-01-20 12:48:06 +01:00
parent e5b33087f3
commit de8928b2d9

View File

@ -203,7 +203,7 @@ const roundedRectBkg = function (elem, node) {
* @returns {number} The height nodes dom element * @returns {number} The height nodes dom element
*/ */
export const drawNode = function (elem, node, fullSection, conf) { export const drawNode = function (elem, node, fullSection, conf) {
const section = fullSection % MAX_SECTIONS; const section = fullSection % (MAX_SECTIONS - 1);
const nodeElem = elem.append('g'); const nodeElem = elem.append('g');
node.section = section; node.section = section;
nodeElem.attr( nodeElem.attr(
@ -303,7 +303,7 @@ export const drawNode = function (elem, node, fullSection, conf) {
}; };
export const drawEdge = function drawEdge(edgesElem, mindmap, parent, depth, fullSection) { 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 sx = parent.x + parent.width / 2;
const sy = parent.y + parent.height / 2; const sy = parent.y + parent.height / 2;
const ex = mindmap.x + mindmap.width / 2; const ex = mindmap.x + mindmap.width / 2;