Skip to content

Commit

Permalink
Use qFuzzyIsNull instead of comparing to 0 with qFuzzyCompare
Browse files Browse the repository at this point in the history
  • Loading branch information
bjorn committed Apr 5, 2014
1 parent 7365fbf commit 3e9713f
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion box2dfixture.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
2 changes: 1 addition & 1 deletion box2dpulleyjoint.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down

0 comments on commit 3e9713f

Please sign in to comment.