diff --git a/Eigen/src/Geometry/Transform.h b/Eigen/src/Geometry/Transform.h index cd9b4f33d..a7756bebe 100644 --- a/Eigen/src/Geometry/Transform.h +++ b/Eigen/src/Geometry/Transform.h @@ -985,8 +985,10 @@ Transform::preshear(const Scalar& sx, const Scalar& sy) { EIGEN_STATIC_ASSERT(int(Dim)==2, YOU_MADE_A_PROGRAMMING_MISTAKE) EIGEN_STATIC_ASSERT(Mode!=int(Isometry), THIS_METHOD_IS_ONLY_FOR_SPECIFIC_TRANSFORMATIONS) - m_matrix.template block(0, 0) = - LinearMatrixType({{1, sy}, {sx, 1}}) * m_matrix.template block(0, 0); + LinearMatrixType shear = LinearMatrixType::Identity(2, 2); + shear.coeffRef(0, 1) = sy; + shear.coeffRef(1, 0) = sx; + m_matrix.template block(0, 0) = shear * m_matrix.template block(0, 0); return *this; }