fix: incorrect section number logic by using index % (MAX_SECTIONS - 1)

on-behalf-of: @Mermaid-Chart <hello@mermaidchart.com>
This commit is contained in:
darshanr0107
2025-11-05 14:54:51 +05:30
parent 74318f9337
commit 61f74ffc5e

View File

@@ -204,7 +204,7 @@ export class MindmapDB {
// For other nodes, inherit parent's section number
if (node.children) {
for (const [index, child] of node.children.entries()) {
const childSectionNumber = node.level === 0 ? (index % MAX_SECTIONS) - 1 : sectionNumber;
const childSectionNumber = node.level === 0 ? index % (MAX_SECTIONS - 1) : sectionNumber;
this.assignSections(child, childSectionNumber);
}
}