diff options
author | Jørgen Lind <jorgen.lind@nokia.com> | 2010-11-16 11:45:15 (GMT) |
---|---|---|
committer | Qt Commercial Integration <QtCommercial@digia.com> | 2012-01-31 10:24:42 (GMT) |
commit | 09846b2babe782e799c9caf1ee08de80feb303e4 (patch) | |
tree | 9074494f2178745a4f79bc8796d3996c03d90396 /src/gui | |
parent | ceacc9f93e8672ee6f08b2283eb863e0b367ade5 (diff) | |
download | Qt-09846b2babe782e799c9caf1ee08de80feb303e4.zip Qt-09846b2babe782e799c9caf1ee08de80feb303e4.tar.gz Qt-09846b2babe782e799c9caf1ee08de80feb303e4.tar.bz2 |
Fix transformIsSimple in QGraphicsScene
The transformIsSimple was a bit to restrictive
Reviewed-by: bnilsen
Diffstat (limited to 'src/gui')
-rw-r--r-- | src/gui/graphicsview/qgraphicsscene.cpp | 19 |
1 files changed, 1 insertions, 18 deletions
diff --git a/src/gui/graphicsview/qgraphicsscene.cpp b/src/gui/graphicsview/qgraphicsscene.cpp index 27639f9..325552a 100644 --- a/src/gui/graphicsview/qgraphicsscene.cpp +++ b/src/gui/graphicsview/qgraphicsscene.cpp @@ -4369,25 +4369,8 @@ static void _q_paintIntoCache(QPixmap *pix, QGraphicsItem *item, const QRegion & static inline bool transformIsSimple(const QTransform& transform) { QTransform::TransformationType type = transform.type(); - if (type == QTransform::TxNone || type == QTransform::TxTranslate) { + if (type <= QTransform::TxScale) { return true; - } else if (type == QTransform::TxScale) { - // Check for 0 and 180 degree rotations. - // (0 might happen after 4 rotations of 90 degrees). - qreal m11 = transform.m11(); - qreal m12 = transform.m12(); - qreal m21 = transform.m21(); - qreal m22 = transform.m22(); - if (m12 == 0.0f && m21 == 0.0f) { - if (m11 == 1.0f && m22 == 1.0f) - return true; // 0 degrees - else if (m11 == -1.0f && m22 == -1.0f) - return true; // 180 degrees. - if(m11 == 1.0f && m22 == -1.0f) - return true; // 0 degrees inverted y. - else if(m11 == -1.0f && m22 == 1.0f) - return true; // 180 degrees inverted y. - } } else if (type == QTransform::TxRotate) { // Check for 90, and 270 degree rotations. qreal m11 = transform.m11(); |