Added canvg callback to opensave extension

git-svn-id: http://svg-edit.googlecode.com/svn/trunk@1693 eee81c28-f429-11dd-99c0-75d572ba1ddd
master
Alexis Deveria 2010-08-31 13:52:54 +00:00
parent fd5b3f52cf
commit 31dd2a429c
1 changed files with 2 additions and 5 deletions

View File

@ -42,10 +42,7 @@ svgEditor.addExtension("server_opensave", {
c.width = svgCanvas.contentW; c.width = svgCanvas.contentW;
c.height = svgCanvas.contentH; c.height = svgCanvas.contentH;
canvg(c, data.svg); canvg(c, data.svg, {renderCallback: function() {
// Timeout to allow canvg to run a bit
setTimeout(function() {
var datauri = c.toDataURL('image/png'); var datauri = c.toDataURL('image/png');
var uiStrings = svgEditor.uiStrings; var uiStrings = svgEditor.uiStrings;
@ -72,7 +69,7 @@ svgEditor.addExtension("server_opensave", {
.append('<input type="hidden" name="filename" value="' + filename + '">') .append('<input type="hidden" name="filename" value="' + filename + '">')
.appendTo('body') .appendTo('body')
.submit().remove(); .submit().remove();
}, 1000); }});
} }