From 2590e21807f29962602ac1420dd5900070205f48 Mon Sep 17 00:00:00 2001 From: wanglin2 <1013335014@qq.com> Date: Sun, 10 Sep 2023 09:05:13 +0800 Subject: [PATCH] =?UTF-8?q?Fix:=E4=B8=8D=E5=AE=8C=E7=BE=8E=E4=BF=AE?= =?UTF-8?q?=E5=A4=8D=E7=BB=84=E7=BB=87=E7=BB=93=E6=9E=84=E5=9B=BE=E6=A6=82?= =?UTF-8?q?=E8=A6=81=E5=92=8C=E8=8A=82=E7=82=B9=E5=86=B2=E7=AA=81=E7=9A=84?= =?UTF-8?q?=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- simple-mind-map/src/layouts/OrganizationStructure.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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) {