From df7f1fe874b3b33201027bba6aff4a2a6688ad01 Mon Sep 17 00:00:00 2001 From: Oliver Jones Date: Sat, 12 Oct 2013 19:28:45 +0100 Subject: [PATCH] Override default isEmpty method for Shape Fixes (new Group([new Shape.Rectangle(...)])).bounds throwing ReferenceError when using Item's isEmpty --- src/item/Shape.js | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/item/Shape.js b/src/item/Shape.js index 3fb3653c..f44ab559 100644 --- a/src/item/Shape.js +++ b/src/item/Shape.js @@ -21,6 +21,16 @@ var Shape = Item.extend(/** @lends Shape# */{ _class: 'Shape', _transformContent: false, + /** + * Assumed that shape can never be empty. + * Fixes (new Group([new Shape.Rectangle(...)])).bounds throwing ReferenceError. + * + * @returns bool + */ + isEmpty: function() { + return false; + }, + initialize: function Shape(type, point, size, props) { this._initialize(props, point); this._type = type;