paper.js/src/item/Layer.js

19 lines
367 B
JavaScript
Raw Normal View History

2011-02-11 12:37:36 -05:00
Layer = Item.extend({
initialize: function() {
this.children = [];
this.document = this.parent = Paper.document;
this.document.layers.push(this);
this.activate();
},
activate: function() {
this.document.activeLayer = this;
2011-02-11 12:37:36 -05:00
},
2011-02-11 12:49:04 -05:00
draw: function(ctx) {
for (var i = 0, l = this.children.length; i < l; i++) {
2011-02-11 12:49:04 -05:00
this.children[i].draw(ctx);
2011-02-11 12:37:36 -05:00
}
}
});