Skip to content
Snippets Groups Projects
Commit 355c0060 authored by Fabian Homborg's avatar Fabian Homborg
Browse files

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.
parent 43611a58
Branches
Tags
No related merge requests found
......@@ -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) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment