Allow setting of styles on empty Groups.

As required by upcoming import SVG fix.
This commit is contained in:
Jürg Lehni 2013-02-14 21:36:58 -08:00
parent a17068fd42
commit 2607d2c075

View file

@ -76,7 +76,7 @@ var Style = Base.extend({
var children = this._getChildren();
// Clone color objects since they reference their owner
value = isColor ? Color.read(arguments, 0, 0, true) : value;
if (children) {
if (children && children.length > 0) {
for (var i = 0, l = children.length; i < l; i++)
children[i][styleKey][set](value);
} else {
@ -103,7 +103,7 @@ var Style = Base.extend({
style;
// If this item has children, walk through all of them and
// see if they all have the same style.
if (!children)
if (!children || children.length === 0)
return this['_' + key];
for (var i = 0, l = children.length; i < l; i++) {
var childStyle = children[i][styleKey][get]();