mirror of
https://github.com/scratchfoundation/paper.js.git
synced 2025-03-16 18:00:02 -04: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();
|
var children = this._getChildren();
|
||||||
// Clone color objects since they reference their owner
|
// Clone color objects since they reference their owner
|
||||||
value = isColor ? Color.read(arguments, 0, 0, true) : value;
|
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++)
|
for (var i = 0, l = children.length; i < l; i++)
|
||||||
children[i][styleKey][set](value);
|
children[i][styleKey][set](value);
|
||||||
} else {
|
} else {
|
||||||
|
@ -103,7 +103,7 @@ var Style = Base.extend({
|
||||||
style;
|
style;
|
||||||
// If this item has children, walk through all of them and
|
// If this item has children, walk through all of them and
|
||||||
// see if they all have the same style.
|
// see if they all have the same style.
|
||||||
if (!children)
|
if (!children || children.length === 0)
|
||||||
return this['_' + key];
|
return this['_' + key];
|
||||||
for (var i = 0, l = children.length; i < l; i++) {
|
for (var i = 0, l = children.length; i < l; i++) {
|
||||||
var childStyle = children[i][styleKey][get]();
|
var childStyle = children[i][styleKey][get]();
|
||||||
|
|
Loading…
Reference in a new issue