From 355c006003817fa7f1224bc2926e15b3db808e5c Mon Sep 17 00:00:00 2001 From: Fabian Homborg <FHomborg@gmail.com> Date: Fri, 16 Aug 2013 23:35:31 +0200 Subject: [PATCH] Properly fix layout switching tiling also needs to have the type declared, because that's used to find the index. Otherwise it'll switch once from the default and then never again. --- contents/code/tiling.js | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/contents/code/tiling.js b/contents/code/tiling.js index 1ac391d..a20a46d 100644 --- a/contents/code/tiling.js +++ b/contents/code/tiling.js @@ -41,23 +41,17 @@ 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 + this.layoutType = layoutType; + this.layout.resetTileSizes(); } Tiling.prototype.setLayoutArea = function(area) { -- GitLab