diff --git a/simple-mind-map/index.js b/simple-mind-map/index.js index 0a25d8da..70c1a7bd 100644 --- a/simple-mind-map/index.js +++ b/simple-mind-map/index.js @@ -409,16 +409,6 @@ class MindMap { draw.translate(-rect.x + elRect.left, -rect.y + elRect.top) // 克隆一份数据 let clone = svg.clone() - // 添加必要的样式 - clone.add(SVG(``)) - // 修正关联线箭头marker的id - const markerList = svg.find('marker') - if (markerList && markerList.length > 0) { - const id = markerList[0].attr('id') - clone.find('marker').forEach(item => { - item.attr('id', id) - }) - } // 如果实际图形宽高超出了屏幕宽高,且存在水印的话需要重新绘制水印,否则会出现超出部分没有水印的问题 if ( (rect.width > origWidth || rect.height > origHeight) && @@ -433,6 +423,16 @@ class MindMap { this.height = origHeight this.watermark.draw() } + // 添加必要的样式 + clone.add(SVG(``)) + // 修正关联线箭头marker的id + const markerList = svg.find('marker') + if (markerList && markerList.length > 0) { + const id = markerList[0].attr('id') + clone.find('marker').forEach(item => { + item.attr('id', id) + }) + } // 恢复原先的大小和变换信息 svg.size(origWidth, origHeight) draw.transform(origTransform)