From ad34bbf7aacab1a97dfbff1bc807873dd1bf07f2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=BCrg=20Lehni?= Date: Thu, 2 Jan 2014 21:47:00 +0100 Subject: [PATCH] Bail out of Item#transform() immediately if there is nothing to do. --- src/item/Item.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/item/Item.js b/src/item/Item.js index 5027d8d5..5c11883b 100644 --- a/src/item/Item.js +++ b/src/item/Item.js @@ -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,