Saving image quality
This commit is contained in:
@@ -130,21 +130,18 @@ function Cursor(rune)
|
||||
|
||||
this.update = function(event)
|
||||
{
|
||||
// if(ronin.terminal.module_name){
|
||||
// this.set_mode(ronin.module);
|
||||
// }
|
||||
// else if(event.altKey == true && event.shiftKey == true){
|
||||
// this.set_mode(ronin.frame.active_layer);
|
||||
// }
|
||||
// else if(event.altKey == true){
|
||||
// this.set_mode(ronin.default);
|
||||
// }
|
||||
// else{
|
||||
// this.set_mode(ronin.brush);
|
||||
// }
|
||||
if(event.altKey == true && event.shiftKey == true){
|
||||
this.set_mode(ronin.frame.active_layer);
|
||||
}
|
||||
else if(event.altKey == true){
|
||||
this.set_mode(ronin.default);
|
||||
}
|
||||
else{
|
||||
this.set_mode(ronin.brush);
|
||||
}
|
||||
}
|
||||
|
||||
this.set_mode = function(mode)
|
||||
this.set_mode = function(mode = ronin.brush)
|
||||
{
|
||||
if(this.mode == mode){ return; }
|
||||
this.mode = mode;
|
||||
|
||||
@@ -2,6 +2,8 @@ function Source(rune)
|
||||
{
|
||||
Module.call(this,rune);
|
||||
|
||||
this.settings = {"format":"jpg","quality":"1"};
|
||||
|
||||
this.add_method(new Method("save",["name","rect","format"]));
|
||||
this.add_method(new Method("load",["path","position","rect"]),"Add point");
|
||||
|
||||
@@ -50,21 +52,24 @@ function Source(rune)
|
||||
|
||||
ronin.terminal.query("terminal.display mini");
|
||||
|
||||
if(this.settings["format"] == "jpg"){
|
||||
ronin.terminal.log(new Log(this,"<img src='"+this.merge().element.toDataURL('image/jpeg',parseFloat(this.settings["quality"]))+"' width='"+ronin.frame.settings["size"].width+"px' height='"+ronin.frame.settings["size"].height+"px'/>","image"));
|
||||
}
|
||||
else{
|
||||
ronin.terminal.log(new Log(this,"<img src='"+this.merge().element.toDataURL('image/png',parseFloat(this.settings["quality"]))+"' width='"+ronin.frame.settings["size"].width+"px' height='"+ronin.frame.settings["size"].height+"px'/>","image"));
|
||||
}
|
||||
/*
|
||||
if(params.setting("format") && params.setting("format").value == "svg"){
|
||||
ronin.terminal.log(new Log(this,ronin.path.create_svg(),"image"));
|
||||
}
|
||||
else if(params.setting("format") && params.setting("format").value == "jpg"){
|
||||
ronin.terminal.log(new Log(this,"<img src='"+this.merge().element.toDataURL('image/png')+"' width='"+ronin.frame.settings["size"].width+"px' height='"+ronin.frame.settings["size"].height+"px'/>","image"));
|
||||
}
|
||||
else if(params.setting("format") && params.setting("format").value == "rin"){
|
||||
var w = window.open('about:blank','source');
|
||||
var html = "";
|
||||
for (i = 0; i < ronin.terminal.history.length; i++) { html += ronin.terminal.history[i]+";<br />"; }
|
||||
w.document.write("<title>Source</title><pre>"+html+"</pre>");
|
||||
}
|
||||
else{
|
||||
ronin.terminal.log(new Log(this,"<img src='"+this.merge().element.toDataURL('image/png')+"' width='"+ronin.frame.settings["size"].width+"px' height='"+ronin.frame.settings["size"].height+"px'/>","image"));
|
||||
}
|
||||
else
|
||||
*/
|
||||
|
||||
this.layer.remove(this);
|
||||
}
|
||||
|
||||
@@ -187,7 +187,7 @@ function Terminal(rune)
|
||||
}
|
||||
}
|
||||
else{
|
||||
ronin.cursor.set_mode(ronin.brush);
|
||||
ronin.cursor.set_mode();
|
||||
}
|
||||
|
||||
this.hint(content);
|
||||
|
||||
Reference in New Issue
Block a user