Skip to content

Commit d66c0d9

Browse files
Eric RowellEric Rowell
Eric Rowell
authored and
Eric Rowell
committed
added layer visible property
1 parent ccfb21a commit d66c0d9

File tree

3 files changed

+9
-5
lines changed

3 files changed

+9
-5
lines changed

build/concrete.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,9 @@
159159
scene.clear();
160160

161161
this.layers.forEach(function(layer) {
162-
scene.context.drawImage(layer.scene.canvas, 0, 0, layer.width, layer.height);
162+
if (layer.visible) {
163+
scene.context.drawImage(layer.scene.canvas, 0, 0, layer.width, layer.height);
164+
}
163165
});
164166
}
165167
};
@@ -182,7 +184,7 @@
182184
this.y = 0;
183185
this.width = 0;
184186
this.height = 0;
185-
187+
this.visible = true;
186188
this.id = idCounter++;
187189
this.hit = new Concrete.Hit();
188190
this.scene = new Concrete.Scene();

build/concrete.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/concrete.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,9 @@
131131
scene.clear();
132132

133133
this.layers.forEach(function(layer) {
134-
scene.context.drawImage(layer.scene.canvas, 0, 0, layer.width, layer.height);
134+
if (layer.visible) {
135+
scene.context.drawImage(layer.scene.canvas, 0, 0, layer.width, layer.height);
136+
}
135137
});
136138
}
137139
};
@@ -154,7 +156,7 @@
154156
this.y = 0;
155157
this.width = 0;
156158
this.height = 0;
157-
159+
this.visible = true;
158160
this.id = idCounter++;
159161
this.hit = new Concrete.Hit();
160162
this.scene = new Concrete.Scene();

0 commit comments

Comments
 (0)