diff --git a/sources/index.html b/sources/index.html
index 1aa4a1c..25ccf6e 100644
--- a/sources/index.html
+++ b/sources/index.html
@@ -7,14 +7,15 @@
-
-
+
+
+
+
-
diff --git a/sources/scripts/keyboard.js b/sources/scripts/keyboard.js
index 056d27e..604d0f4 100644
--- a/sources/scripts/keyboard.js
+++ b/sources/scripts/keyboard.js
@@ -14,7 +14,9 @@ function Keyboard()
if(e.key == "Escape"){
e.preventDefault();
- ronin.commander.input_el.blur();;
+ ronin.commander.input_el.blur();
+ ronin.commander.input_el.value = "";
+ ronin.guide.update();
}
if(e.key == "]"){
diff --git a/sources/scripts/grid.js b/sources/scripts/layers/grid.js
similarity index 100%
rename from sources/scripts/grid.js
rename to sources/scripts/layers/grid.js
diff --git a/sources/scripts/guide.js b/sources/scripts/layers/guide.js
similarity index 100%
rename from sources/scripts/guide.js
rename to sources/scripts/layers/guide.js
diff --git a/sources/scripts/render.js b/sources/scripts/layers/render.js
similarity index 100%
rename from sources/scripts/render.js
rename to sources/scripts/layers/render.js
diff --git a/sources/scripts/modules/frame.js b/sources/scripts/modules/frame.js
index 00c684f..899660f 100644
--- a/sources/scripts/modules/frame.js
+++ b/sources/scripts/modules/frame.js
@@ -8,10 +8,11 @@ function Frame()
this.methods.resize = function(q)
{
- if(q.indexOf("x") == -1){ return; }
+ var data = ronin.render.select(0,0,ronin.frame.settings.width,ronin.frame.settings.height);
- var size = {width:parseInt(q.split("x")[0]),height:parseInt(q.split("x")[1])};
- ronin.frame.resize(size);
+ ronin.render.clear();
+ ronin.frame.resize_to(q);
+ ronin.render.context().putImageData(data, 0, 0);
}
this.methods.rescale = function(p)
diff --git a/sources/scripts/ronin.js b/sources/scripts/ronin.js
index feee9b6..24e1b31 100644
--- a/sources/scripts/ronin.js
+++ b/sources/scripts/ronin.js
@@ -3,20 +3,27 @@ function Ronin()
this.el = document.createElement('yu');
this.el.id = "ronin";
- this.grid = new Grid();
this.io = new IO();
this.keyboard = new Keyboard();
this.commander = new Commander();
this.cursor = new Cursor();
- this.render = new Render();
this.hint = new Hint();
+
+ this.grid = new Grid();
this.guide = new Guide();
+ this.render = new Render();
this.brush = new Brush();
this.eraser = new Eraser();
this.frame = new Frame();
this.line = new Line();
+ this.layers = {
+ grid : this.grid,
+ guide : this.guide,
+ render : this.render,
+ };
+
this.modules = {
brush : this.brush,
eraser : this.eraser,
@@ -28,6 +35,9 @@ function Ronin()
{
document.body.appendChild(this.el);
+ this.frame.settings.width = window.innerWidth;
+ this.frame.settings.height = window.innerHeight;
+
this.grid.install();
this.guide.install();
this.render.install();