From 9aae8bf55c624b7ad3f710bb25198f490020501e Mon Sep 17 00:00:00 2001 From: wanglin2 <1013335014@qq.com> Date: Tue, 17 Oct 2023 14:02:08 +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=AF=BC=E5=87=BA=E5=9B=BE?= =?UTF-8?q?=E7=89=87=E3=80=81svg=E3=80=81pdf=E6=97=B6=E6=AF=8F=E4=B8=AA?= =?UTF-8?q?=E8=8A=82=E7=82=B9=E9=83=BD=E4=BC=9A=E6=98=BE=E7=A4=BA=E8=BE=B9?= =?UTF-8?q?=E6=A1=86=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- simple-mind-map/index.js | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) 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)