Implemented #21

This commit is contained in:
Devine Lu Linvega
2018-05-13 09:50:19 +12:00
parent c40b266076
commit db872c033c
4 changed files with 22 additions and 9 deletions

View File

@@ -48,10 +48,14 @@ function Renderer()
this.layer_3.setAttribute("d",paths[2])
}
this.to_png = function(size = {width:1280,height:1280},callback = dotgrid.render)
this.to_png = function(size = dotgrid.tool.settings.size,callback = dotgrid.render)
{
this.refresh();
// Upscale
size.width *= 2
size.height *= 2
var xml = new XMLSerializer().serializeToString(this.svg_el);
var svg64 = btoa(xml);
var b64Start = 'data:image/svg+xml;base64,';