Only decompose matrix if there are bounds to be reused.

This commit is contained in:
Jürg Lehni 2013-12-07 05:50:08 +01:00
parent 43e0ac5124
commit 3d94ff6968

View file

@ -2563,8 +2563,8 @@ var Item = Base.extend(Callback, /** @lends Item# */{
// Detect matrices that contain only translations and scaling
// and transform the cached _bounds and _position without having to
// fully recalculate each time.
var decomp = matrix.decompose();
if (bounds && decomp && !decomp.shearing && decomp.angle % 90 === 0) {
var decomp = bounds && matrix.decompose();
if (decomp && !decomp.shearing && decomp.angle % 90 === 0) {
// Transform the old bound by looping through all the cached bounds
// in _bounds and transform each.
for (var key in bounds) {