From 14e1e1dea0a628fa45ddbf76e079d63f68140ccd Mon Sep 17 00:00:00 2001 From: ZhangMingZhao1 <1104272319@qq.com> Date: Fri, 15 Nov 2024 11:48:46 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8Dsafari=E5=AF=BC?= =?UTF-8?q?=E5=87=BA=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- simple-mind-map/src/plugins/Export.js | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/simple-mind-map/src/plugins/Export.js b/simple-mind-map/src/plugins/Export.js index bb57645b..8e53c5a6 100644 --- a/simple-mind-map/src/plugins/Export.js +++ b/simple-mind-map/src/plugins/Export.js @@ -289,7 +289,17 @@ class Export { this.handleNodeExport(node) const { str, clipData } = await this.getSvgData(node) const svgUrl = await this.fixSvgStrAndToBlob(str) - const res = await this.svgToPng(svgUrl, transparent, clipData) + const isSafari = () => { + return ( + navigator.userAgent.includes('Safari') && + !navigator.userAgent.includes('Chrome') + ) + } + let res + res = await this.svgToPng(svgUrl, transparent, clipData) + if (isSafari()) { + res = await this.svgToPng(svgUrl, transparent, clipData) + } return res }