Re-implemented io.load
This commit is contained in:
parent
7693356826
commit
b5972beb1a
@ -43,7 +43,6 @@ function IO()
|
||||
|
||||
ronin.io.draw_image(ronin.cursor.target.context(),ronin.io.image,ronin.commander.query().methods.draw);
|
||||
ronin.io.image = null;
|
||||
ronin.preview.clear();
|
||||
});
|
||||
|
||||
this.methods.save = new Method("save","jpg/png","Export canvas.",function(q){
|
||||
@ -58,14 +57,14 @@ function IO()
|
||||
});
|
||||
});
|
||||
|
||||
this.preview = function(q)
|
||||
{
|
||||
ronin.preview.clear();
|
||||
// this.preview = function(q)
|
||||
// {
|
||||
// ronin.preview.clear();
|
||||
|
||||
if(ronin.commander.query().methods.draw && this.image){
|
||||
this.draw_image(ronin.preview.context(),this.image,ronin.commander.query().methods.draw);
|
||||
}
|
||||
}
|
||||
// if(ronin.commander.query().methods.draw && this.image){
|
||||
// this.draw_image(ronin.preview.context(),this.image,ronin.commander.query().methods.draw);
|
||||
// }
|
||||
// }
|
||||
|
||||
this.render = function()
|
||||
{
|
||||
@ -77,7 +76,7 @@ function IO()
|
||||
return export_layer;
|
||||
}
|
||||
|
||||
this.draw_image = function(ctx = ronin.preview.context(),img,params)
|
||||
this.draw_image = function(ctx,img,params)
|
||||
{
|
||||
var width = parseInt(img.naturalWidth * 0.5);
|
||||
var height = parseInt(img.naturalHeight * 0.5);
|
||||
|
@ -76,6 +76,8 @@ function Ronin()
|
||||
this.controller.add("default","File","Open",() => { ronin.open(); },"CmdOrCtrl+O");
|
||||
this.controller.add("default","File","Save",() => { ronin.save(); },"CmdOrCtrl+S");
|
||||
|
||||
this.controller.add("default","I/O","Import Image",() => { ronin.io.methods.load.run(); },"CmdOrCtrl+I");
|
||||
|
||||
this.controller.add("default","Layers","Above Layer",() => { ronin.cursor.select_layer(ronin.layers.above); },"c");
|
||||
this.controller.add("default","Layers","Below Layer",() => { ronin.cursor.select_layer(ronin.layers.below); },"z");
|
||||
this.controller.add("default","Layers","Toggle Layer",() => { ronin.cursor.swap_layer(); },"x");
|
||||
|
Loading…
x
Reference in New Issue
Block a user