1
0
mirror of https://github.com/tumic0/GPXSee.git synced 2024-11-24 11:45:53 +01:00

If there are multiple labels for a point, use the one with the highest priority

This commit is contained in:
Martin Tůma 2023-08-19 13:36:20 +02:00
parent f683525fce
commit 04ef7ba092

View File

@ -10,7 +10,7 @@ using namespace Mapsforge;
#define PATHS_EXTENT 20 #define PATHS_EXTENT 20
#define SEARCH_EXTENT -0.5 #define SEARCH_EXTENT -0.5
static double limit = cos(deg2rad(170)); static double LIMIT = cos(deg2rad(170));
static qreal area(const QPainterPath &polygon) static qreal area(const QPainterPath &polygon)
{ {
@ -78,7 +78,7 @@ static QPainterPath parallelPath(const QPainterPath &p, double dy)
if (k == 0) if (k == 0)
continue; continue;
if (u.at(k).x() * u.at(k-1).x() + u.at(k).y() * u.at(k-1).y() < limit) if (u.at(k).x() * u.at(k-1).x() + u.at(k).y() * u.at(k-1).y() < LIMIT)
return p; return p;
} }
@ -127,9 +127,8 @@ void RasterTile::processPointLabels(const QList<MapData::Point> &points,
if ((lbl = label(ri->key(), point.tags))) { if ((lbl = label(ri->key(), point.tags))) {
if (si && si->id() != ri->symbolId()) if (si && si->id() != ri->symbolId())
continue; continue;
if (!ti || ti->priority() < ri->priority())
ti = ri; ti = ri;
break;
} }
} }
} }