Fix:修复存在水印时小地图渲染非常慢的问题
This commit is contained in:
parent
9e4652b7b5
commit
4fc2d79616
@ -388,7 +388,7 @@ class MindMap {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// 获取svg数据
|
// 获取svg数据
|
||||||
getSvgData({ paddingX = 0, paddingY = 0 } = {}) {
|
getSvgData({ paddingX = 0, paddingY = 0, ignoreWatermark = false } = {}) {
|
||||||
const svg = this.svg
|
const svg = this.svg
|
||||||
const draw = this.draw
|
const draw = this.draw
|
||||||
// 保存原始信息
|
// 保存原始信息
|
||||||
@ -412,6 +412,7 @@ class MindMap {
|
|||||||
let clone = svg.clone()
|
let clone = svg.clone()
|
||||||
// 如果实际图形宽高超出了屏幕宽高,且存在水印的话需要重新绘制水印,否则会出现超出部分没有水印的问题
|
// 如果实际图形宽高超出了屏幕宽高,且存在水印的话需要重新绘制水印,否则会出现超出部分没有水印的问题
|
||||||
if (
|
if (
|
||||||
|
!ignoreWatermark &&
|
||||||
(rect.width > origWidth || rect.height > origHeight) &&
|
(rect.width > origWidth || rect.height > origHeight) &&
|
||||||
this.watermark &&
|
this.watermark &&
|
||||||
this.watermark.hasWatermark()
|
this.watermark.hasWatermark()
|
||||||
|
|||||||
@ -28,7 +28,9 @@ class MiniMap {
|
|||||||
*/
|
*/
|
||||||
calculationMiniMap(boxWidth, boxHeight) {
|
calculationMiniMap(boxWidth, boxHeight) {
|
||||||
let { svg, rect, origWidth, origHeight, scaleX, scaleY } =
|
let { svg, rect, origWidth, origHeight, scaleX, scaleY } =
|
||||||
this.mindMap.getSvgData()
|
this.mindMap.getSvgData({
|
||||||
|
ignoreWatermark: true
|
||||||
|
})
|
||||||
// 计算数据
|
// 计算数据
|
||||||
const elRect = this.mindMap.elRect
|
const elRect = this.mindMap.elRect
|
||||||
rect.x -= elRect.left
|
rect.x -= elRect.left
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user