summaryrefslogtreecommitdiff
path: root/include/mbgl/util/geo.hpp
diff options
context:
space:
mode:
authorBruno de Oliveira Abinader <bruno@mapbox.com>2016-03-08 23:45:57 +0200
committerBruno de Oliveira Abinader <bruno@mapbox.com>2016-03-10 03:36:46 +0200
commitb33b2f1515060d0c447fdf09f52935db1c076430 (patch)
tree4f50560f9732156180f1ce37583305cd0ea057ef /include/mbgl/util/geo.hpp
parente8d1276bb10159423fb6b0b07cd02d5cced96f05 (diff)
downloadqtlocation-mapboxgl-b33b2f1515060d0c447fdf09f52935db1c076430.tar.gz
[core] Check for NaNs in EdgeInsets
Diffstat (limited to 'include/mbgl/util/geo.hpp')
-rw-r--r--include/mbgl/util/geo.hpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/include/mbgl/util/geo.hpp b/include/mbgl/util/geo.hpp
index 9e2d7a2bb1..94fbdc3d09 100644
--- a/include/mbgl/util/geo.hpp
+++ b/include/mbgl/util/geo.hpp
@@ -199,9 +199,10 @@ public:
: top(t), left(l), bottom(b), right(r) {}
explicit operator bool() const {
- return top || left || bottom || right;
+ return !(std::isnan(top) || std::isnan(left) || std::isnan(bottom) || std::isnan(right))
+ && (top || left || bottom || right);
}
-
+
void operator+=(const EdgeInsets& o) {
top += o.top;
left += o.left;