mirror of
https://github.com/scratchfoundation/paper.js.git
synced 2025-01-05 20:32:00 -05:00
Allow setting of styles on empty Groups.
As required by upcoming import SVG fix.
This commit is contained in:
parent
a17068fd42
commit
2607d2c075
1 changed files with 2 additions and 2 deletions
|
@ -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]();
|
||||
|
|
Loading…
Reference in a new issue