Skip to content

Commit a3657a1

Browse files
authored
Visibility (#120)
1 parent 0caff1a commit a3657a1

File tree

3 files changed

+3
-1
lines changed

3 files changed

+3
-1
lines changed

src/building.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,9 @@ class Building {
150150
this.outerElement.options.building.visible = false;
151151
const outerMeshes = this.outerElement.render();
152152
outerMeshes[0].visible = false;
153+
this.outerElement.options.roof.visible = false;
153154
outerMeshes[1].visible = false;
155+
this.outerElement.options.building.visible = false;
154156
mesh.push(...outerMeshes);
155157
for (let i = 0; i < this.parts.length; i++) {
156158
mesh.push(...this.parts[i].render());

src/buildingpart.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,6 @@ class BuildingPart {
193193
this.createRoof();
194194
this.parts.push(this.roof);
195195
const mesh = this.createBuilding();
196-
this.options.building.visible = true;
197196
if (this.getAttribute('building:part') === 'roof') {
198197
mesh.visible = false;
199198
this.options.building.visible = false;

test/building.test.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,7 @@ test('Invisible Outer Building', () => {
8484
const mesh = bldg.render();
8585
//expect outer building and roof to not be visible
8686
expect(mesh[0].visible).toBe(false);
87+
expect(bldg.outerElement.options.building.visible).toBe(false);
8788
expect(mesh[1].visible).toBe(false);
8889
});
8990

0 commit comments

Comments
 (0)