From 3e9713fc6aaf771e07f0639c4e307d00eaba4f65 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thorbj=C3=B8rn=20Lindeijer?= Date: Sat, 5 Apr 2014 22:08:13 +0200 Subject: [PATCH] Use qFuzzyIsNull instead of comparing to 0 with qFuzzyCompare --- box2dfixture.cpp | 2 +- box2dpulleyjoint.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/box2dfixture.cpp b/box2dfixture.cpp index 1564a201..32c2d3fd 100644 --- a/box2dfixture.cpp +++ b/box2dfixture.cpp @@ -186,7 +186,7 @@ void Box2DFixture::geometryChanged(const QRectF &newGeometry, const QRectF &oldG qreal ow = oldGeometry.width(); qreal oh = oldGeometry.height(); - if (!qFuzzyCompare(ow, 0.0) && !qFuzzyCompare(oh, 0.0) && newGeometry != oldGeometry) { + if (!qFuzzyIsNull(ow) && !qFuzzyIsNull(oh) && newGeometry != oldGeometry) { factorWidth = nw / ow; factorHeight = nh / oh; scale(); diff --git a/box2dpulleyjoint.cpp b/box2dpulleyjoint.cpp index 9ff5e623..bcb8881a 100644 --- a/box2dpulleyjoint.cpp +++ b/box2dpulleyjoint.cpp @@ -144,7 +144,7 @@ void Box2DPulleyJoint::setLocalAnchorB(const QPointF &localAnchorB) b2Joint *Box2DPulleyJoint::createJoint() { - if (qFuzzyCompare(mPulleyJointDef.lengthA, 0.0f) || qFuzzyCompare(mPulleyJointDef.lengthB, 0.0f)) { + if (qFuzzyIsNull(mPulleyJointDef.lengthA) || qFuzzyIsNull(mPulleyJointDef.lengthB)) { qWarning() << "PulleyJoint: the joint length cannot be zero"; return 0; }