mirror of
https://github.com/scratchfoundation/paper.js.git
synced 2025-01-20 22:39:50 -05:00
Merge pull request #308 from ojj11/isEmptyFix
Override default isEmpty method for Shape
This commit is contained in:
commit
bc85dd1dc3
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