mirror of
https://github.com/scratchfoundation/paper.js.git
synced 2025-01-06 04:42:15 -05:00
Override default isEmpty method for Shape
Fixes (new Group([new Shape.Rectangle(...)])).bounds throwing ReferenceError when using Item's isEmpty
This commit is contained in:
parent
dfa1687a90
commit
df7f1fe874
1 changed files with 10 additions and 0 deletions
|
@ -21,6 +21,16 @@ var Shape = Item.extend(/** @lends Shape# */{
|
||||||
_class: 'Shape',
|
_class: 'Shape',
|
||||||
_transformContent: false,
|
_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) {
|
initialize: function Shape(type, point, size, props) {
|
||||||
this._initialize(props, point);
|
this._initialize(props, point);
|
||||||
this._type = type;
|
this._type = type;
|
||||||
|
|
Loading…
Reference in a new issue