From 31dd2a429c2a07b1a9230fd0e164ce79a3b7caac Mon Sep 17 00:00:00 2001 From: Alexis Deveria Date: Tue, 31 Aug 2010 13:52:54 +0000 Subject: [PATCH] Added canvg callback to opensave extension git-svn-id: http://svg-edit.googlecode.com/svn/trunk@1693 eee81c28-f429-11dd-99c0-75d572ba1ddd --- editor/extensions/ext-server_opensave.js | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/editor/extensions/ext-server_opensave.js b/editor/extensions/ext-server_opensave.js index 61107ac4..d197c372 100644 --- a/editor/extensions/ext-server_opensave.js +++ b/editor/extensions/ext-server_opensave.js @@ -42,10 +42,7 @@ svgEditor.addExtension("server_opensave", { c.width = svgCanvas.contentW; c.height = svgCanvas.contentH; - canvg(c, data.svg); - - // Timeout to allow canvg to run a bit - setTimeout(function() { + canvg(c, data.svg, {renderCallback: function() { var datauri = c.toDataURL('image/png'); var uiStrings = svgEditor.uiStrings; @@ -72,7 +69,7 @@ svgEditor.addExtension("server_opensave", { .append('') .appendTo('body') .submit().remove(); - }, 1000); + }}); }