Bail out of Item#transform() immediately if there is nothing to do.

This commit is contained in:
Jürg Lehni 2014-01-02 21:47:00 +01:00
parent 469aa18f1a
commit ad34bbf7aa

View file

@ -2721,6 +2721,9 @@ var Item = Base.extend(Callback, /** @lends Item# */{
// 'children', 'fill-gradients', 'fill-patterns', 'stroke-patterns',
// 'lines'. Default: ['objects', 'children']
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
// on matrix we can calculate and set them again.
var bounds = this._bounds,