diff --git a/src/item/Item.js b/src/item/Item.js index 6e816cff..7ea0be97 100644 --- a/src/item/Item.js +++ b/src/item/Item.js @@ -370,6 +370,10 @@ var Item = this.Item = Base.extend(Callback, { setStyle: function(style) { this._style.initialize(style); + }, + + hasFill: function() { + return !!this._style.getFillColor(); } }, Base.each(['locked', 'visible', 'blendMode', 'opacity', 'guide'], // Produce getter/setters for properties. We need setters because we want to diff --git a/src/path/Path.js b/src/path/Path.js index f58ce7f7..12b6bc0b 100644 --- a/src/path/Path.js +++ b/src/path/Path.js @@ -1599,9 +1599,9 @@ var Path = this.Path = PathItem.extend(/** @lends Path# */{ hasFill: function() { // If this path is part of a CompoundPath, we need to check that // for fillColor too... - return this._style.getFillColor() + return !!(this._style.getFillColor() || this._parent._type === 'compound-path' - && this._parent._style.getFillColor(); + && this._parent._style.getFillColor()); }, contains: function(point) {