mirror of
https://github.com/scratchfoundation/paper.js.git
synced 2025-07-27 22:29:11 -04:00
Improve _bounds handling by introducing Item#_createBounds() that always uses LinkedRectangle class.
This commit is contained in:
parent
8b66c4fa83
commit
37f5a64dce
4 changed files with 22 additions and 19 deletions
src/path
|
@ -1766,11 +1766,10 @@ var Path = this.Path = PathItem.extend({
|
|||
// Pass the matrix hidden from Bootstrap, so it still inject
|
||||
// getBounds as bean too.
|
||||
if (!useCache || !this._bounds) {
|
||||
var bounds = getBounds(this, arguments[0]);
|
||||
if (!useCache)
|
||||
return bounds;
|
||||
this._bounds = LinkedRectangle.create(this, 'setBounds',
|
||||
bounds.x, bounds.y, bounds.width, bounds.height);
|
||||
var bounds = this._createBounds(getBounds(this, arguments[0]));
|
||||
if (useCache)
|
||||
this._bounds = bounds;
|
||||
return bounds;
|
||||
}
|
||||
return this._bounds;
|
||||
},
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue