Commit 48114ecc authored by zhangbobell's avatar zhangbobell

fix(export): remove canvas after exporting png

parent a189a89f
......@@ -235,14 +235,20 @@ define(function(require, exports, module) {
DomURL.revokeObjectURL(svgDataUrl);
document.body.appendChild(canvas);
return generateDataUrl(canvas);
var pngBase64 = generateDataUrl(canvas);
document.body.removeChild(canvas);
return pngBase64;
}, function(err) {
// 这里处理 reject,出错基本上是因为跨域,
// 出错后依然导出,只不过没有图片。
alert('脑图的节点中包含跨域图片,导出的 png 中节点图片不显示,你可以替换掉这些跨域的图片并重试。');
DomURL.revokeObjectURL(svgDataUrl);
document.body.appendChild(canvas);
return generateDataUrl(canvas);
var pngBase64 = generateDataUrl(canvas);
document.body.removeChild(canvas);
return pngBase64;
});
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment