summaryrefslogtreecommitdiffstats
path: root/src/gui/painting
diff options
context:
space:
mode:
authorLars Knoll <lars.knoll@nokia.com>2009-06-02 19:02:42 (GMT)
committerAndreas Aardal Hanssen <andreas.aardal.hanssen@nokia.com>2009-06-09 07:31:25 (GMT)
commit07dca7a30d4bd1efd8032915700420cca3fd60fa (patch)
tree414937afaf27e0876bdfcf315da498acfb1e2623 /src/gui/painting
parentbdb0c0fc98fc1998f6a7ee21be29513534be3713 (diff)
downloadQt-07dca7a30d4bd1efd8032915700420cca3fd60fa.zip
Qt-07dca7a30d4bd1efd8032915700420cca3fd60fa.tar.gz
Qt-07dca7a30d4bd1efd8032915700420cca3fd60fa.tar.bz2
implement equality operator in a more sane way
Using qFuzzyCompare for checking whether two transformations are equal doesn't give us too much and is inconsistent with our other matrix classes. Using simple floating point equality is a lot faster as well.
Diffstat (limited to 'src/gui/painting')
-rw-r--r--src/gui/painting/qtransform.cpp14
1 files changed, 9 insertions, 5 deletions
diff --git a/src/gui/painting/qtransform.cpp b/src/gui/painting/qtransform.cpp
index 86e594c..bd2ea31 100644
--- a/src/gui/painting/qtransform.cpp
+++ b/src/gui/painting/qtransform.cpp
@@ -700,11 +700,15 @@ QTransform & QTransform::rotateRadians(qreal a, Qt::Axis axis)
*/
bool QTransform::operator==(const QTransform &o) const
{
-#define qFZ qFuzzyCompare
- return qFZ(affine._m11, o.affine._m11) && qFZ(affine._m12, o.affine._m12) && qFZ(m_13, o.m_13)
- && qFZ(affine._m21, o.affine._m21) && qFZ(affine._m22, o.affine._m22) && qFZ(m_23, o.m_23)
- && qFZ(affine._dx, o.affine._dx) && qFZ(affine._dy, o.affine._dy) && qFZ(m_33, o.m_33);
-#undef qFZ
+ return affine._m11 == o.affine._m11 &&
+ affine._m12 == o.affine._m12 &&
+ affine._m21 == o.affine._m21 &&
+ affine._m22 == o.affine._m22 &&
+ affine._dx == o.affine._dx &&
+ affine._dy == o.affine._dy &&
+ m_13 == o.m_13 &&
+ m_23 == o.m_23 &&
+ m_33 == o.m_33;
}
/*!