summaryrefslogtreecommitdiffstats
path: root/tests/auto/qtransform
diff options
context:
space:
mode:
authorSamuel Rødal <sroedal@trolltech.com>2009-04-22 14:49:24 +0200
committerSamuel Rødal <sroedal@trolltech.com>2009-04-22 16:03:59 +0200
commitcf9db492ac60568bd159c3749dfa11e2347b9927 (patch)
treef52c740d74180974fbb3a040d375b9d4bc9cc887 /tests/auto/qtransform
parent3696886a327fc4894518c5570b02d5238dcede8a (diff)
Prevent QTransform::type() from returning TxScale instead of TxProject.
We have code that assumes that m33 = 1 if the type is TxScale. Instead of changing all that code it's better to just return TxProject as type when m33 is different from 1. Reviewed-by: Simon Hausmann
Diffstat (limited to 'tests/auto/qtransform')
-rw-r--r--tests/auto/qtransform/tst_qtransform.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/tests/auto/qtransform/tst_qtransform.cpp b/tests/auto/qtransform/tst_qtransform.cpp
index 8516ddb200..74c405e1b8 100644
--- a/tests/auto/qtransform/tst_qtransform.cpp
+++ b/tests/auto/qtransform/tst_qtransform.cpp
@@ -593,6 +593,16 @@ void tst_QTransform::types()
m3.translate(5.0f, 5.0f);
QCOMPARE(m3.type(), QTransform::TxScale);
QCOMPARE(m3.inverted().type(), QTransform::TxScale);
+
+ m3.setMatrix(1.0f, 0.0f, 0.0f,
+ 0.0f, 1.0f, 0.0f,
+ 0.0f, 0.0f, 2.0f);
+ QCOMPARE(m3.type(), QTransform::TxProject);
+
+ m3.setMatrix(0.0f, 2.0f, 0.0f,
+ 1.0f, 0.0f, 0.0f,
+ 0.0f, 0.0f, 2.0f);
+ QCOMPARE(m3.type(), QTransform::TxProject);
}