From 6985d387fb64e805de981b83ae0934014360b4a8 Mon Sep 17 00:00:00 2001 From: Agriya Dev5 Date: Fri, 8 Jan 2021 19:57:13 +0530 Subject: [PATCH] #52 Fix the export --- src/svgcanvas/svg-exec.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/svgcanvas/svg-exec.js b/src/svgcanvas/svg-exec.js index fcb43ba4..2198350e 100644 --- a/src/svgcanvas/svg-exec.js +++ b/src/svgcanvas/svg-exec.js @@ -727,7 +727,10 @@ export const rasterExport = async function (imgType, quality, exportWindowName, c.width = svgContext_.getCanvas().contentW; c.height = svgContext_.getCanvas().contentH; const canvg = svgContext_.getcanvg(); - await canvg(c, svg); + const ctx = c.getContext('2d'); + const v = canvg.fromString(ctx, svg); + // Render only first frame, ignoring animations. + await v.render(); // Todo: Make async/await utility in place of `toBlob`, so we can remove this constructor // eslint-disable-next-line promise/avoid-new return new Promise((resolve, reject) => {