diff --git a/Eigen/src/Geometry/Transform.h b/Eigen/src/Geometry/Transform.h index 077441da8..fd3fc58f4 100644 --- a/Eigen/src/Geometry/Transform.h +++ b/Eigen/src/Geometry/Transform.h @@ -943,7 +943,8 @@ EIGEN_DEVICE_FUNC Transform& Transform(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 2fddf55cc..a9eb87e25 100644 --- a/test/geo_transformations.cpp +++ b/test/geo_transformations.cpp @@ -273,6 +273,12 @@ void transformations() { .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();