From d3ccec2256d86ca67047b8730b88b1f95b4223ad Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=BCrg=20Lehni?= Date: Fri, 15 Feb 2013 18:01:23 -0800 Subject: [PATCH] Use the code from Group#isEmpty() and CompoundPath#isEmpty() for Item#isEmpty(), since any item that does not have children overrides it. --- src/item/Group.js | 4 ---- src/item/Item.js | 2 +- src/path/CompoundPath.js | 4 ---- 3 files changed, 1 insertion(+), 9 deletions(-) diff --git a/src/item/Group.js b/src/item/Group.js index c6786328..6a031b2d 100644 --- a/src/item/Group.js +++ b/src/item/Group.js @@ -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) { diff --git a/src/item/Item.js b/src/item/Item.js index 37c1f6c5..98fdc956 100644 --- a/src/item/Item.js +++ b/src/item/Item.js @@ -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) { diff --git a/src/path/CompoundPath.js b/src/path/CompoundPath.js index 2677b658..d8bc51de 100644 --- a/src/path/CompoundPath.js +++ b/src/path/CompoundPath.js @@ -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;