Fix:导出png、svg、pdf时先结束当前正在进行的文本编辑,防止导出的节点文本显示空白的问题

This commit is contained in:
街角小林
2025-03-12 09:12:10 +08:00
parent e5648728c4
commit 45418d803c

View File

@@ -286,6 +286,7 @@ class Export {
* 方法2.把svg的图片提取出来再挨个绘制到canvas里最后一起转换
*/
async png(name, transparent = false, node = null) {
this.mindMap.renderer.textEdit.hideEditTextBox()
this.handleNodeExport(node)
const { str, clipData } = await this.getSvgData(node)
const svgUrl = await this.fixSvgStrAndToBlob(str)
@@ -330,6 +331,7 @@ class Export {
// 导出为svg
async svg(name) {
this.mindMap.renderer.textEdit.hideEditTextBox()
const { node } = await this.getSvgData()
node.first().before(SVG(`<title>${name}</title>`))
await this.drawBackgroundToSvg(node)