mirror of
https://github.com/scratchfoundation/paper.js.git
synced 2025-01-04 03:45:58 -05:00
Implement Item#hasFill().
This commit is contained in:
parent
acd3236989
commit
bb03c72ce8
2 changed files with 6 additions and 2 deletions
|
@ -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
|
||||
|
|
|
@ -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) {
|
||||
|
|
Loading…
Reference in a new issue