mirror of
https://github.com/tumic0/GPXSee.git
synced 2024-11-28 05:34:47 +01:00
isNull() & isValid() logic improvement
This commit is contained in:
parent
2b7d0cd631
commit
141e0cb404
@ -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<Coordinates, Coordinates> boundingRect(qreal distance) const;
|
||||
|
@ -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;}
|
||||
|
Loading…
Reference in New Issue
Block a user