Only preserve bounds if there is no shearing in the transformation.

Closes #358.
This commit is contained in:
Jürg Lehni 2013-12-07 05:19:49 +01:00
parent 7c5d377133
commit 2d307f0e7c

View file

@ -2552,7 +2552,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.
if (bounds && matrix.getRotation() % 90 === 0) {
var decomp = matrix.decompose();
if (bounds && 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) {