Fix:修复存在水印时小地图渲染非常慢的问题

This commit is contained in:
wanglin2
2023-10-17 16:09:31 +08:00
parent 9e4652b7b5
commit 4fc2d79616
2 changed files with 5 additions and 2 deletions

View File

@@ -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()

View File

@@ -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