From 04ef7ba0928025c16f031c4ed15acdefd5ced8c0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20T=C5=AFma?= Date: Sat, 19 Aug 2023 13:36:20 +0200 Subject: [PATCH] If there are multiple labels for a point, use the one with the highest priority --- src/map/mapsforge/rastertile.cpp | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/map/mapsforge/rastertile.cpp b/src/map/mapsforge/rastertile.cpp index 6868708f..2cb96733 100644 --- a/src/map/mapsforge/rastertile.cpp +++ b/src/map/mapsforge/rastertile.cpp @@ -10,7 +10,7 @@ using namespace Mapsforge; #define PATHS_EXTENT 20 #define SEARCH_EXTENT -0.5 -static double limit = cos(deg2rad(170)); +static double LIMIT = cos(deg2rad(170)); static qreal area(const QPainterPath &polygon) { @@ -78,7 +78,7 @@ static QPainterPath parallelPath(const QPainterPath &p, double dy) if (k == 0) 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; } @@ -127,9 +127,8 @@ void RasterTile::processPointLabels(const QList &points, if ((lbl = label(ri->key(), point.tags))) { if (si && si->id() != ri->symbolId()) continue; - - ti = ri; - break; + if (!ti || ti->priority() < ri->priority()) + ti = ri; } } }