mirror of
https://github.com/tumic0/GPXSee.git
synced 2024-11-24 03:35:53 +01:00
Check for bounds overflow in the computed/approximated case
This commit is contained in:
parent
722f3acb1e
commit
00fff55cd3
@ -4,6 +4,7 @@
|
||||
|
||||
|
||||
#define SAMPLES 100
|
||||
#define DELTA 1e-6
|
||||
|
||||
static void growLeft(const Coordinates &c, RectC &rect)
|
||||
{
|
||||
@ -55,6 +56,11 @@ RectC Map::llBounds(const Projection &proj)
|
||||
growRight(xy2ll(QPointF(b.right(), y)), rect);
|
||||
}
|
||||
|
||||
if (rect.right() <= -180.0 + DELTA)
|
||||
rect.setRight(180.0);
|
||||
if (rect.left() >= 180.0 - DELTA)
|
||||
rect.setLeft(-180.0);
|
||||
|
||||
return rect;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user