Implement Item#hasFill().

This commit is contained in:
Jürg Lehni 2013-04-20 20:40:20 -07:00
parent acd3236989
commit bb03c72ce8
2 changed files with 6 additions and 2 deletions

View file

@ -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

View file

@ -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) {