From f11f364d0087a7d178c61e6bd4bb129bee6f5575 Mon Sep 17 00:00:00 2001 From: wanglin <1013335014@qq.com> Date: Sun, 31 Jul 2022 22:29:40 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=B0=E5=A2=9E=E6=96=B9=E6=B3=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- simple-mind-map/src/layouts/Base.js | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/simple-mind-map/src/layouts/Base.js b/simple-mind-map/src/layouts/Base.js index 58747abf..c77af193 100644 --- a/simple-mind-map/src/layouts/Base.js +++ b/simple-mind-map/src/layouts/Base.js @@ -167,6 +167,24 @@ class Base { return layerIndex === 1 ? this.mindMap.themeConfig.second.marginY : this.mindMap.themeConfig.node.marginY; } + /** + * @Author: 王林 + * @Date: 2022-07-31 20:53:12 + * @Desc: 获取节点包括概要在内的宽度 + */ + getNodeWidthWithGeneralization(node) { + return Math.max(node.width, node._generalizationNode ? node._generalizationNode.width : 0) + } + + /** + * @Author: 王林 + * @Date: 2022-07-31 20:53:12 + * @Desc: 获取节点包括概要在内的高度 + */ + getNodeHeightWithGeneralization(node) { + return Math.max(node.height, node._generalizationNode ? node._generalizationNode.height : 0) + } + /** * @Author: 王林 * @Date: 2022-07-31 09:14:03