Moved merge to Save
This commit is contained in:
parent
d768306ab1
commit
0e06026b10
@ -20,13 +20,26 @@ function FileSave(rune)
|
|||||||
var d = null;
|
var d = null;
|
||||||
|
|
||||||
if(cmd.variable("format") && cmd.variable("format").value == "jpg"){
|
if(cmd.variable("format") && cmd.variable("format").value == "jpg"){
|
||||||
var d = ronin.surface.active_layer.element.toDataURL('image/jpeg');
|
var d = this.merge().element.toDataURL('image/jpeg');
|
||||||
}
|
}
|
||||||
else{
|
else{
|
||||||
var d = ronin.surface.active_layer.element.toDataURL('image/png');
|
var d = this.merge().element.toDataURL('image/png');
|
||||||
}
|
}
|
||||||
|
|
||||||
var w = window.open('about:blank','image from canvas');
|
var w = window.open('about:blank','image from canvas');
|
||||||
w.document.write("<title>Untitled</title><body><img src='"+d+"' width='"+ronin.surface.size.width+"px' height='"+ronin.surface.size.height+"px'/></body>");
|
w.document.write("<title>Untitled</title><body><img src='"+d+"' width='"+ronin.surface.size.width+"px' height='"+ronin.surface.size.height+"px'/></body>");
|
||||||
|
this.layer.clear();
|
||||||
|
}
|
||||||
|
|
||||||
|
this.merge = function()
|
||||||
|
{
|
||||||
|
var a = [];
|
||||||
|
Object.keys(ronin.surface.layers).forEach(function (key) {
|
||||||
|
a.push(ronin.surface.layers[key]);
|
||||||
|
});
|
||||||
|
for (i = 0; i < a.length; i++) {
|
||||||
|
this.layer.context().drawImage(a[i].context().canvas,0,0,ronin.surface.size.width,ronin.surface.size.height);
|
||||||
|
}
|
||||||
|
return this.layer;
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -132,22 +132,6 @@ function Surface(rune)
|
|||||||
return this.active_layer.context();
|
return this.active_layer.context();
|
||||||
}
|
}
|
||||||
|
|
||||||
this.merge = function()
|
|
||||||
{
|
|
||||||
// this.render_layer = this.layers["render"];
|
|
||||||
|
|
||||||
// var a = [];
|
|
||||||
// Object.keys(ronin.surface.layers).forEach(function (key) {
|
|
||||||
// if(key != "render"){
|
|
||||||
// a.push(ronin.surface.layers[key]);
|
|
||||||
// }
|
|
||||||
// });
|
|
||||||
// for (i = a.length; i > 0 ; i--) {
|
|
||||||
// ronin.surface.render_layer.context().drawImage(a[i-1].context().canvas,0,0,this.size.width,this.size.height);
|
|
||||||
// }
|
|
||||||
return this.context();
|
|
||||||
}
|
|
||||||
|
|
||||||
// Cursor
|
// Cursor
|
||||||
|
|
||||||
this.drag_from = null;
|
this.drag_from = null;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user