diff --git a/Eigen/src/Geometry/Transform.h b/Eigen/src/Geometry/Transform.h index 52b8c2a4e..cd9b4f33d 100644 --- a/Eigen/src/Geometry/Transform.h +++ b/Eigen/src/Geometry/Transform.h @@ -985,7 +985,8 @@ 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, sx, sy, 1) * m_matrix.template block(0,0); + m_matrix.template block(0, 0) = + LinearMatrixType({{1, sy}, {sx, 1}}) * m_matrix.template block(0, 0); return *this; } diff --git a/test/geo_transformations.cpp b/test/geo_transformations.cpp index 72c6edac1..ed31c304a 100644 --- a/test/geo_transformations.cpp +++ b/test/geo_transformations.cpp @@ -276,6 +276,12 @@ template void transformations() VERIFY( (t20.fromPositionOrientationScale(v20,a,v21) * (t21.prescale(v21.cwiseInverse()).translate(-v20))).matrix().isIdentity(test_precision()) ); + t20.setIdentity(); + t20.shear(Scalar(2), Scalar(3)); + Transform2 t23 = t20 * t21; + t21.preshear(Scalar(2), Scalar(3)); + VERIFY_IS_APPROX(t21, t23); + // Transform - new API // 3D t0.setIdentity();