1
0
mirror of https://github.com/tumic0/GPXSee.git synced 2025-01-19 04:02:09 +01:00

Path tick distance now based on map resolution rather then path length.

This commit is contained in:
Martin Tůma 2019-05-29 18:38:49 +02:00
parent fe69280cc5
commit 47206316b7

View File

@ -295,24 +295,24 @@ qreal PathItem::xInM() const
unsigned PathItem::tickSize() const unsigned PathItem::tickSize() const
{ {
qreal r = _path.last().last().distance() / xInM(); qreal res = _map->resolution(sceneBoundingRect());
if (r < 1) if (res < 10)
return 0;
else if (r < 15)
return 1; return 1;
else if (r < 50) else if (res < 25)
return 5; return 5;
else if (r < 150) else if (res < 100)
return 10; return 10;
else if (r < 500) else if (res < 500)
return 50; return 50;
else if (r < 1500) else if (res < 2000)
return 100; return 100;
else if (r < 5000) else if (res < 10000)
return 500; return 500;
else else if (res < 20000)
return 1000; return 1000;
else
return 5000;
} }
void PathItem::updateTicks() void PathItem::updateTicks()