diff --git a/src/gui/painting/qtransform.cpp b/src/gui/painting/qtransform.cpp index bfb0e6f4ec1..34dd425fef3 100644 --- a/src/gui/painting/qtransform.cpp +++ b/src/gui/painting/qtransform.cpp @@ -2046,7 +2046,7 @@ QTransform::TransformationType QTransform::type() const case TxShear: case TxRotate: if (!qFuzzyIsNull(m_matrix[0][1]) || !qFuzzyIsNull(m_matrix[1][0])) { - const qreal dot = m_matrix[0][0] * m_matrix[0][1] + m_matrix[1][0] * m_matrix[1][1]; + const qreal dot = m_matrix[0][0] * m_matrix[1][0] + m_matrix[0][1] * m_matrix[1][1]; if (qFuzzyIsNull(dot)) m_type = TxRotate; else diff --git a/tests/auto/gui/painting/qtransform/tst_qtransform.cpp b/tests/auto/gui/painting/qtransform/tst_qtransform.cpp index 2dcb564e2ba..a3ff1b0081d 100644 --- a/tests/auto/gui/painting/qtransform/tst_qtransform.cpp +++ b/tests/auto/gui/painting/qtransform/tst_qtransform.cpp @@ -384,8 +384,9 @@ void tst_QTransform::types() QCOMPARE(m1.inverted().type(), QTransform::TxScale); m1.rotate(45.0f); - QCOMPARE(m1.type(), QTransform::TxRotate); - QCOMPARE(m1.inverted().type(), QTransform::TxRotate); + // Rotation after non-uniform scaling -> shearing. Uniform scale + rotate tested below. + QCOMPARE(m1.type(), QTransform::TxShear); + QCOMPARE(m1.inverted().type(), QTransform::TxShear); m1.shear(0.5f, 0.25f); QCOMPARE(m1.type(), QTransform::TxShear);