From b33b2f1515060d0c447fdf09f52935db1c076430 Mon Sep 17 00:00:00 2001 From: Bruno de Oliveira Abinader Date: Tue, 8 Mar 2016 23:45:57 +0200 Subject: [core] Check for NaNs in EdgeInsets --- include/mbgl/util/geo.hpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'include/mbgl/util/geo.hpp') 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; -- cgit v1.2.1