mirror of
https://github.com/scratchfoundation/paper.js.git
synced 2025-01-06 04:42:15 -05:00
Bail out of Item#transform() immediately if there is nothing to do.
This commit is contained in:
parent
469aa18f1a
commit
ad34bbf7aa
1 changed files with 3 additions and 0 deletions
|
@ -2721,6 +2721,9 @@ var Item = Base.extend(Callback, /** @lends Item# */{
|
||||||
// 'children', 'fill-gradients', 'fill-patterns', 'stroke-patterns',
|
// 'children', 'fill-gradients', 'fill-patterns', 'stroke-patterns',
|
||||||
// 'lines'. Default: ['objects', 'children']
|
// 'lines'. Default: ['objects', 'children']
|
||||||
transform: function(matrix /*, applyMatrix */) {
|
transform: function(matrix /*, applyMatrix */) {
|
||||||
|
// Bail out immediatelly if there is nothing to do
|
||||||
|
if (matrix.isIdentity())
|
||||||
|
return this;
|
||||||
// Calling _changed will clear _bounds and _position, but depending
|
// Calling _changed will clear _bounds and _position, but depending
|
||||||
// on matrix we can calculate and set them again.
|
// on matrix we can calculate and set them again.
|
||||||
var bounds = this._bounds,
|
var bounds = this._bounds,
|
||||||
|
|
Loading…
Reference in a new issue