Implement Item#isEmpty() for the various types.

And use it to tell #getBounds() when to ignore items.
This commit is contained in:
Jürg Lehni 2012-10-10 20:11:11 -07:00
parent adb2ddc615
commit e17e94b50b
7 changed files with 29 additions and 1 deletions

View file

@ -85,6 +85,10 @@ var CompoundPath = this.CompoundPath = PathItem.extend(/** @lends CompoundPath#
this._children[i].smooth();
},
isEmpty: function() {
return this._children.length == 0;
},
draw: function(ctx, param) {
var children = this._children;
// Return early if the compound path doesn't have any children: