mirror of
https://github.com/scratchfoundation/paper.js.git
synced 2025-01-06 04:42:15 -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) {
|
setStyle: function(style) {
|
||||||
this._style.initialize(style);
|
this._style.initialize(style);
|
||||||
|
},
|
||||||
|
|
||||||
|
hasFill: function() {
|
||||||
|
return !!this._style.getFillColor();
|
||||||
}
|
}
|
||||||
}, Base.each(['locked', 'visible', 'blendMode', 'opacity', 'guide'],
|
}, Base.each(['locked', 'visible', 'blendMode', 'opacity', 'guide'],
|
||||||
// Produce getter/setters for properties. We need setters because we want to
|
// 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() {
|
hasFill: function() {
|
||||||
// If this path is part of a CompoundPath, we need to check that
|
// If this path is part of a CompoundPath, we need to check that
|
||||||
// for fillColor too...
|
// for fillColor too...
|
||||||
return this._style.getFillColor()
|
return !!(this._style.getFillColor()
|
||||||
|| this._parent._type === 'compound-path'
|
|| this._parent._type === 'compound-path'
|
||||||
&& this._parent._style.getFillColor();
|
&& this._parent._style.getFillColor());
|
||||||
},
|
},
|
||||||
|
|
||||||
contains: function(point) {
|
contains: function(point) {
|
||||||
|
|
Loading…
Reference in a new issue