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:
Jürg Lehni 2013-02-15 18:01:23 -08:00
parent eebcbda9d3
commit d3ccec2256
3 changed files with 1 additions and 9 deletions

View file

@ -116,10 +116,6 @@ var Group = this.Group = Item.extend(/** @lends Group# */{
return this;
},
isEmpty: function() {
return this._children.length == 0;
},
draw: function(ctx, param) {
var clipItem = this._getClipItem();
if (clipItem) {

View file

@ -638,7 +638,7 @@ var Item = this.Item = Base.extend(Callback, {
* @type Boolean
*/
isEmpty: function() {
return true;
return this._children.length == 0;
}
}, Base.each(['getBounds', 'getStrokeBounds', 'getHandleBounds', 'getRoughBounds'],
function(name) {

View file

@ -96,10 +96,6 @@ var CompoundPath = this.CompoundPath = PathItem.extend(/** @lends CompoundPath#
return curves;
},
isEmpty: function() {
return this._children.length == 0;
},
contains: function(point) {
point = Point.read(arguments);
var count = 0;