From 4fc2d796169db7f1984cf94ce1484cfb16a4c285 Mon Sep 17 00:00:00 2001 From: wanglin2 <1013335014@qq.com> Date: Tue, 17 Oct 2023 16:09:31 +0800 Subject: [PATCH] =?UTF-8?q?Fix=EF=BC=9A=E4=BF=AE=E5=A4=8D=E5=AD=98?= =?UTF-8?q?=E5=9C=A8=E6=B0=B4=E5=8D=B0=E6=97=B6=E5=B0=8F=E5=9C=B0=E5=9B=BE?= =?UTF-8?q?=E6=B8=B2=E6=9F=93=E9=9D=9E=E5=B8=B8=E6=85=A2=E7=9A=84=E9=97=AE?= =?UTF-8?q?=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- simple-mind-map/index.js | 3 ++- simple-mind-map/src/plugins/MiniMap.js | 4 +++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/simple-mind-map/index.js b/simple-mind-map/index.js index 42bd6508..cd9cd531 100644 --- a/simple-mind-map/index.js +++ b/simple-mind-map/index.js @@ -388,7 +388,7 @@ class MindMap { } // 获取svg数据 - getSvgData({ paddingX = 0, paddingY = 0 } = {}) { + getSvgData({ paddingX = 0, paddingY = 0, ignoreWatermark = false } = {}) { const svg = this.svg const draw = this.draw // 保存原始信息 @@ -412,6 +412,7 @@ class MindMap { let clone = svg.clone() // 如果实际图形宽高超出了屏幕宽高,且存在水印的话需要重新绘制水印,否则会出现超出部分没有水印的问题 if ( + !ignoreWatermark && (rect.width > origWidth || rect.height > origHeight) && this.watermark && this.watermark.hasWatermark() diff --git a/simple-mind-map/src/plugins/MiniMap.js b/simple-mind-map/src/plugins/MiniMap.js index 6d719517..b7763a2a 100644 --- a/simple-mind-map/src/plugins/MiniMap.js +++ b/simple-mind-map/src/plugins/MiniMap.js @@ -28,7 +28,9 @@ class MiniMap { */ calculationMiniMap(boxWidth, boxHeight) { let { svg, rect, origWidth, origHeight, scaleX, scaleY } = - this.mindMap.getSvgData() + this.mindMap.getSvgData({ + ignoreWatermark: true + }) // 计算数据 const elRect = this.mindMap.elRect rect.x -= elRect.left