mirror of
https://github.com/tumic0/GPXSee.git
synced 2025-01-31 09:05:14 +01:00
Numerical instability fix
This commit is contained in:
parent
e34800b8d1
commit
c50e41dea1
@ -8,6 +8,7 @@
|
||||
|
||||
|
||||
#define TILE_SIZE 256
|
||||
#define EPSILON 1e-6
|
||||
|
||||
static QPointF ll2m(const Coordinates &c)
|
||||
{
|
||||
@ -36,7 +37,7 @@ static qreal zoom2scale(int zoom)
|
||||
|
||||
static int scale2zoom(qreal scale)
|
||||
{
|
||||
return (int)log2(360.0/(scale * (qreal)TILE_SIZE));
|
||||
return (int)(log2(360.0/(scale * (qreal)TILE_SIZE)) + EPSILON);
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user