diff --git a/src/path/Path.js b/src/path/Path.js index 5a3c48cb..e655f82a 100644 --- a/src/path/Path.js +++ b/src/path/Path.js @@ -1626,8 +1626,7 @@ var Path = PathItem.extend(/** @lends Path# */{ getStyle: function() { // If this path is part of a CompoundPath, use the paren't style instead var parent = this._parent; - return (parent && parent._type === 'compound-path' - ? parent : this)._style; + return (parent && parent instanceof CompoundPath ? parent : this)._style; }, // DOCS: toShape diff --git a/src/style/Style.js b/src/style/Style.js index 38e2db4c..4e7f763a 100644 --- a/src/style/Style.js +++ b/src/style/Style.js @@ -175,7 +175,7 @@ var Style = Base.extend(new function() { // they all have the same style. // If true is passed for dontMerge, don't merge children styles if (!children || children.length === 0 || arguments[0] - || this._item._type === 'compound-path') { + || this._item instanceof CompoundPath) { var value = this._values[key]; if (value === undefined) { value = this._defaults[key];