summaryrefslogtreecommitdiffstats
path: root/src/gui/painting
diff options
context:
space:
mode:
authorSamuel Rødal <sroedal@trolltech.com>2009-04-22 12:49:24 (GMT)
committerSamuel Rødal <sroedal@trolltech.com>2009-04-22 14:03:59 (GMT)
commitcf9db492ac60568bd159c3749dfa11e2347b9927 (patch)
treef52c740d74180974fbb3a040d375b9d4bc9cc887 /src/gui/painting
parent3696886a327fc4894518c5570b02d5238dcede8a (diff)
downloadQt-cf9db492ac60568bd159c3749dfa11e2347b9927.zip
Qt-cf9db492ac60568bd159c3749dfa11e2347b9927.tar.gz
Qt-cf9db492ac60568bd159c3749dfa11e2347b9927.tar.bz2
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 'src/gui/painting')
-rw-r--r--src/gui/painting/qtransform.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/gui/painting/qtransform.cpp b/src/gui/painting/qtransform.cpp
index 39e429d..af27fd5 100644
--- a/src/gui/painting/qtransform.cpp
+++ b/src/gui/painting/qtransform.cpp
@@ -1880,7 +1880,7 @@ const QMatrix &QTransform::toAffine() const
QTransform::TransformationType QTransform::type() const
{
if (m_dirty >= m_type) {
- if (m_dirty > TxShear && (!qFuzzyCompare(m_13 + 1, 1) || !qFuzzyCompare(m_23 + 1, 1)))
+ if (m_dirty > TxShear && (!qFuzzyCompare(m_13 + 1, 1) || !qFuzzyCompare(m_23 + 1, 1) || !qFuzzyCompare(m_33, 1)))
m_type = TxProject;
else if (m_dirty > TxScale && (!qFuzzyCompare(affine._m12 + 1, 1) || !qFuzzyCompare(affine._m21 + 1, 1))) {
const qreal dot = affine._m11 * affine._m12 + affine._m21 * affine._m22;
@@ -1888,7 +1888,7 @@ QTransform::TransformationType QTransform::type() const
m_type = TxRotate;
else
m_type = TxShear;
- } else if (m_dirty > TxTranslate && (!qFuzzyCompare(affine._m11, 1) || !qFuzzyCompare(affine._m22, 1) || !qFuzzyCompare(m_33, 1)))
+ } else if (m_dirty > TxTranslate && (!qFuzzyCompare(affine._m11, 1) || !qFuzzyCompare(affine._m22, 1)))
m_type = TxScale;
else if (m_dirty > TxNone && (!qFuzzyCompare(affine._dx + 1, 1) || !qFuzzyCompare(affine._dy + 1, 1)))
m_type = TxTranslate;