mirror of
https://github.com/scratchfoundation/paper.js.git
synced 2025-01-19 14:10:14 -05:00
No need to calculate matrix before handling cached values.
This commit is contained in:
parent
733d879bb6
commit
1eadc87b58
1 changed files with 7 additions and 7 deletions
|
@ -575,13 +575,6 @@ function(name) {
|
|||
// transformed with the internally stored _matrix, (the default if no
|
||||
// matrix is passed).
|
||||
var cache = (!matrix || matrix.equals(this._matrix)) && type;
|
||||
// If the result of concatinating the passed matrix with our internal
|
||||
// one is an identity transformation, set it to null for faster
|
||||
// processing
|
||||
var identity = this._matrix.isIdentity();
|
||||
matrix = !matrix || matrix.isIdentity()
|
||||
? identity ? null : this._matrix
|
||||
: identity ? matrix : matrix.clone().concatenate(this._matrix);
|
||||
// Set up a boundsCache structure that keeps track of items that keep
|
||||
// cached bounds that depend on this item. We store this in our parent,
|
||||
// for multiple reasons:
|
||||
|
@ -610,6 +603,13 @@ function(name) {
|
|||
}
|
||||
if (cache && this._bounds && this._bounds[cache])
|
||||
return this._bounds[cache];
|
||||
// If the result of concatinating the passed matrix with our internal
|
||||
// one is an identity transformation, set it to null for faster
|
||||
// processing
|
||||
var identity = this._matrix.isIdentity();
|
||||
matrix = !matrix || matrix.isIdentity()
|
||||
? identity ? null : this._matrix
|
||||
: identity ? matrix : matrix.clone().concatenate(this._matrix);
|
||||
// If we're caching bounds on this item, pass it on as cacheItem, so the
|
||||
// children can setup the _boundsCache structures for it.
|
||||
var bounds = this._getBounds(type, matrix, cache ? this : cacheItem);
|
||||
|
|
Loading…
Reference in a new issue