diff --git a/simple-mind-map/src/layouts/CatalogOrganization.js b/simple-mind-map/src/layouts/CatalogOrganization.js index 4cf06569..7013ef76 100644 --- a/simple-mind-map/src/layouts/CatalogOrganization.js +++ b/simple-mind-map/src/layouts/CatalogOrganization.js @@ -87,11 +87,11 @@ class CatalogOrganization extends Base { totalLeft += cur.width + marginX }) } else { - let totalTop = node.top + node.height + marginY + node.expandBtnSize + let totalTop = node.top + node.height + marginY + (this.getNodeActChildrenLength(node) > 0 ? node.expandBtnSize : 0) node.children.forEach(cur => { cur.left = node.left + node.width * 0.5 cur.top = totalTop - totalTop += cur.height + marginY + node.expandBtnSize + totalTop += cur.height + marginY + (this.getNodeActChildrenLength(cur) > 0 ? cur.expandBtnSize : 0) }) } } @@ -124,10 +124,9 @@ class CatalogOrganization extends Base { let marginY = this.getMarginY(layerIndex + 1) let totalHeight = node.children.reduce((h, item) => { - return h + item.height + return h + item.height + (this.getNodeActChildrenLength(item) > 0 ? item.expandBtnSize : 0) }, 0) + - (len + 1) * marginY + - len * node.expandBtnSize + (len + 1) * marginY this.updateBrothersTop(node, totalHeight) } },