mirror of
https://github.com/scratchfoundation/paper.js.git
synced 2025-01-07 13:22:07 -05:00
Use the code from Group#isEmpty() and CompoundPath#isEmpty() for Item#isEmpty(), since any item that does not have children overrides it.
This commit is contained in:
parent
eebcbda9d3
commit
d3ccec2256
3 changed files with 1 additions and 9 deletions
|
@ -116,10 +116,6 @@ var Group = this.Group = Item.extend(/** @lends Group# */{
|
||||||
return this;
|
return this;
|
||||||
},
|
},
|
||||||
|
|
||||||
isEmpty: function() {
|
|
||||||
return this._children.length == 0;
|
|
||||||
},
|
|
||||||
|
|
||||||
draw: function(ctx, param) {
|
draw: function(ctx, param) {
|
||||||
var clipItem = this._getClipItem();
|
var clipItem = this._getClipItem();
|
||||||
if (clipItem) {
|
if (clipItem) {
|
||||||
|
|
|
@ -638,7 +638,7 @@ var Item = this.Item = Base.extend(Callback, {
|
||||||
* @type Boolean
|
* @type Boolean
|
||||||
*/
|
*/
|
||||||
isEmpty: function() {
|
isEmpty: function() {
|
||||||
return true;
|
return this._children.length == 0;
|
||||||
}
|
}
|
||||||
}, Base.each(['getBounds', 'getStrokeBounds', 'getHandleBounds', 'getRoughBounds'],
|
}, Base.each(['getBounds', 'getStrokeBounds', 'getHandleBounds', 'getRoughBounds'],
|
||||||
function(name) {
|
function(name) {
|
||||||
|
|
|
@ -96,10 +96,6 @@ var CompoundPath = this.CompoundPath = PathItem.extend(/** @lends CompoundPath#
|
||||||
return curves;
|
return curves;
|
||||||
},
|
},
|
||||||
|
|
||||||
isEmpty: function() {
|
|
||||||
return this._children.length == 0;
|
|
||||||
},
|
|
||||||
|
|
||||||
contains: function(point) {
|
contains: function(point) {
|
||||||
point = Point.read(arguments);
|
point = Point.read(arguments);
|
||||||
var count = 0;
|
var count = 0;
|
||||||
|
|
Loading…
Reference in a new issue