From 0d5602b8323dc318d05c4d5675af2c12fc42d532 Mon Sep 17 00:00:00 2001 From: wanglin2 <1013335014@qq.com> Date: Sat, 9 Sep 2023 11:35:13 +0800 Subject: [PATCH] =?UTF-8?q?Fix:=E4=B8=8D=E5=AE=8C=E7=BE=8E=E7=9A=84?= =?UTF-8?q?=E8=A7=A3=E5=86=B3=E9=80=BB=E8=BE=91=E7=BB=93=E6=9E=84=E5=9B=BE?= =?UTF-8?q?=E6=A6=82=E8=A6=81=E5=92=8C=E8=8A=82=E7=82=B9=E7=9A=84=E5=86=B2?= =?UTF-8?q?=E7=AA=81=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/LogicalStructure.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/simple-mind-map/src/layouts/LogicalStructure.js b/simple-mind-map/src/layouts/LogicalStructure.js index 01ac0325..d66955cd 100644 --- a/simple-mind-map/src/layouts/LogicalStructure.js +++ b/simple-mind-map/src/layouts/LogicalStructure.js @@ -56,6 +56,9 @@ class LogicalStructure extends Base { }, 0) + (len + 1) * this.getMarginY(layerIndex + 1) : 0 + // 如果存在概要,则和概要的高度取最大值 + let generalizationNodeHeight = cur._node.checkHasGeneralization() ? cur._node._generalizationNodeHeight + this.getMarginY(layerIndex + 1) : 0 + cur._node.childrenAreaHeight2 = Math.max(cur._node.childrenAreaHeight, generalizationNodeHeight) }, true, 0 @@ -99,9 +102,8 @@ class LogicalStructure extends Base { } // 判断子节点所占的高度之和是否大于该节点自身,大于则需要调整位置 let difference = - node.childrenAreaHeight - - this.getMarginY(layerIndex + 1) * 2 - - node.height + node.childrenAreaHeight2 - + this.getMarginY(layerIndex + 1) * 2 - node.height if (difference > 0) { this.updateBrothers(node, difference / 2) }