diff --git a/contents/code/tiling.js b/contents/code/tiling.js index 6cd8b0f7b7414185b71c7d0648f2c8097d9e8e14..1ac391d9aceb5a5507a958babdef22e2c07cc46b 100644 --- a/contents/code/tiling.js +++ b/contents/code/tiling.js @@ -40,10 +40,23 @@ function Tiling(screenRectangle, layoutType) { */ this.active = false; + this.screenRectangle = screenRectangle; // TODO } Tiling.prototype.setLayoutType = function(layoutType) { + print("setLayoutType"); + print(layoutType.name); + //print(this.layout.name); + var newLayout = new layoutType(this.layout.screenRectangle); + print("Adding ", this.layout.tiles.length, "tiles"); + for(i = 0; i < this.layout.tiles.length; i++) { + newLayout.addTile(); + this.layout.tiles[i].tileIndex = i; + } + this.layout = newLayout; + //print(this.layout.name); + print("new layout type"); // TODO }