diff --git a/src/coordinates.h b/src/coordinates.h index 02221f38..6fc09983 100644 --- a/src/coordinates.h +++ b/src/coordinates.h @@ -22,8 +22,8 @@ public: bool isNull() const {return std::isnan(_lon) && std::isnan(_lat);} bool isValid() const - {return (!std::isnan(_lon) && !std::isnan(_lat) - && _lon >= -180.0 && _lon <= 180.0 && _lat >= -90.0 && _lat <= 90.0);} + {return (_lon >= -180.0 && _lon <= 180.0 + && _lat >= -90.0 && _lat <= 90.0);} qreal distanceTo(const Coordinates &c) const; QPair boundingRect(qreal distance) const; diff --git a/src/rectc.h b/src/rectc.h index c1d87b1e..f14b939d 100644 --- a/src/rectc.h +++ b/src/rectc.h @@ -15,7 +15,7 @@ public: bool isNull() const {return _tl.isNull() && _br.isNull();} bool isValid() const - {return !(_tl.isNull() || _br.isNull() || _tl == _br);} + {return (_tl.isValid() && _br.isValid() && _tl != _br);} Coordinates topLeft() const {return _tl;} Coordinates bottomRight() const {return _br;}