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