diff --git a/simple-mind-map/src/layouts/OrganizationStructure.js b/simple-mind-map/src/layouts/OrganizationStructure.js index 179ef4c2..c3b49092 100644 --- a/simple-mind-map/src/layouts/OrganizationStructure.js +++ b/simple-mind-map/src/layouts/OrganizationStructure.js @@ -57,6 +57,10 @@ class OrganizationStructure extends Base { }, 0) + (len + 1) * this.getMarginY(layerIndex + 1) : 0 + + // 如果存在概要,则和概要的高度取最大值 + let generalizationNodeWidth = cur._node.checkHasGeneralization() ? cur._node._generalizationNodeWidth + this.getMarginY(layerIndex + 1) : 0 + cur._node.childrenAreaWidth2 = Math.max(cur._node.childrenAreaWidth, generalizationNodeWidth) }, true, 0 @@ -100,7 +104,7 @@ class OrganizationStructure extends Base { } // 判断子节点所占的宽度之和是否大于该节点自身,大于则需要调整位置 let difference = - node.childrenAreaWidth - + node.childrenAreaWidth2 - this.getMarginY(layerIndex + 1) * 2 - node.width if (difference > 0) {