aboutsummaryrefslogtreecommitdiff
path: root/scatterplot.cpp
diff options
context:
space:
mode:
authorSamuel Fadel <samuelfadel@gmail.com>2016-02-02 17:42:04 -0200
committerSamuel Fadel <samuelfadel@gmail.com>2016-02-02 17:42:04 -0200
commitdc50effe61c833da9c15b886d5ebba65620b99f0 (patch)
treebb5718d861b5765416ef0879c4f1d52bfec3560e /scatterplot.cpp
parented6386edd202de8ba3a737ce1e33499370edcaed (diff)
Using std::numeric_limits where appropriate.
Diffstat (limited to 'scatterplot.cpp')
-rw-r--r--scatterplot.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/scatterplot.cpp b/scatterplot.cpp
index 97f2f41..acf9e36 100644
--- a/scatterplot.cpp
+++ b/scatterplot.cpp
@@ -2,6 +2,7 @@
#include <algorithm>
#include <cmath>
+#include <limits>
#include <QSGGeometryNode>
#include <QSGSimpleRectNode>
@@ -139,7 +140,7 @@ int QuadTree::nearestTo(float x, float y) const
if (q >= 0) return q;
}
- float dist = 1.0f / 0.0f;
+ float dist = std::numeric_limits<float>::infinity();
nearestTo(x, y, q, dist);
if (dist < BRUSHING_MAX_DIST * BRUSHING_MAX_DIST)
return q;