uxebu / bonsai

BonsaiJS is a graphics library and renderer
http://bonsaijs.org
Other
1.96k stars 189 forks source link

Add sugar to Groups that applies attr on childrens #146

Open basecode opened 12 years ago

basecode commented 12 years ago

We could introduce a method on Groups that applies attributes on the children.

API could look like this new Group().attrAll({fillColor: 'red'}) and is basically a convenient wrapper for

this.children.forEach(f(child) {
  child.attr(attrs);
})