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

Fix layout switching - tiles need to be migrated over and the screenRectangle given to the layout

parent a490d0ad
No related branches found
No related tags found
No related merge requests found
...@@ -40,10 +40,23 @@ function Tiling(screenRectangle, layoutType) { ...@@ -40,10 +40,23 @@ function Tiling(screenRectangle, layoutType) {
*/ */
this.active = false; this.active = false;
this.screenRectangle = screenRectangle;
// TODO // TODO
} }
Tiling.prototype.setLayoutType = function(layoutType) { 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 // TODO
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment