diff --git a/scripts/commander.js b/scripts/commander.js
index 7904cf6..57e547e 100644
--- a/scripts/commander.js
+++ b/scripts/commander.js
@@ -55,48 +55,6 @@ function Commander(element,element_input)
}
this.hide();
-
- /*
- var parts = command;
-
- // Brush
- if(parts[0] == "&"){
- parts.shift();
- brush.settings(parts);
- }
-
- // Pointers
- if(parts[0] == ">"){
- parts.shift();
- brush.add(parts);
- }
-
- // Save
- if(parts[0] == "$"){
- var d=canvas.toDataURL("image/png");
- var w=window.open('about:blank','image from canvas');
- w.document.write("
"+parts[1]+"
");
- }
-
- // Load
- if(parts[0] == "/"){
- parts.shift();
- ronin.load_image(parts);
- }
-
- // Fill
- if(parts[0] == "*"){
- parts.shift();
- ronin.fill(parts);
- }
-
- // Guides
- if(parts[0] == "|"){
- parts.shift();
- ronin.add_guide(parts);
- }
-
- */
}
this.passive = function(cmd_array)
@@ -134,15 +92,5 @@ function Commander(element,element_input)
ronin.filter.passive(cmd);
break;
}
-
- /*
-
- // Draw
- if(parts[0] == "/"){
- parts.shift();
- parts.shift();
- ronin.guide(parts);
- }
- */
}
}
\ No newline at end of file
diff --git a/scripts/ronin.file.js b/scripts/ronin.file.js
index 399ccd1..e763683 100644
--- a/scripts/ronin.file.js
+++ b/scripts/ronin.file.js
@@ -2,9 +2,21 @@ function File()
{
Module.call(this);
- this.active = function()
+ this.active = function(cmd)
{
ronin.overlay.clear();
+
+ if(!cmd.position()){ return; }
+ if(!cmd.rect()){ return; }
+
+ var position = cmd.position() ? cmd.position() : new Position();
+
+ base_image = new Image();
+ base_image.src = cmd.path();
+ base_image.onload = function(){
+ position.normalize(cmd.rect());
+ context.drawImage(base_image, position.x, position.y, cmd.rect().width, cmd.rect().height);
+ }
}
this.passive = function(cmd)
@@ -20,4 +32,11 @@ function File()
ronin.overlay.draw(position);
}
}
+
+ this.save = function(cmd)
+ {
+ var d=canvas.toDataURL("image/png");
+ var w=window.open('about:blank','image from canvas');
+ w.document.write(""+(cmd.cmd_array[0] ? cmd.cmd_array[0] : "Untitled")+"
");
+ }
}
\ No newline at end of file
diff --git a/scripts/ronin.js b/scripts/ronin.js
index 8754f24..7e442ae 100644
--- a/scripts/ronin.js
+++ b/scripts/ronin.js
@@ -6,25 +6,6 @@ function Ronin()
this.brush = new Brush();
this.file = new File();
- this.load_image = function(p)
- {
- base_image = new Image();
- base_image.src = p[0]; // media/logo.png
- base_image.onload = function(){
-
- var rec_w = parseFloat(p[3]);
- var rec_h = parseFloat(p[4]);
- var pos_x = parseFloat(p[1]);
- var pos_y = parseFloat(p[2]);
-
- pos_x = pos_x < 0 ? canvas.width - Math.abs(pos_x) - rec_w : pos_x;
- pos_y = pos_y < 0 ? canvas.height - Math.abs(pos_y) - rec_h : pos_y;
-
- context.drawImage(base_image, pos_x, pos_y, rec_w, rec_h);
- }
- this.draw_guides();
- }
-
this.fill = function(p)
{
cvSave = canvas.toDataURL("image/png");