From 7a9e4171f9a64f4c65c2f806ab984fec5f25f74f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20T=C5=AFma?= Date: Tue, 18 Jun 2024 18:43:54 +0200 Subject: [PATCH] Fix cut-off labels --- src/map/ENC/rastertile.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/map/ENC/rastertile.cpp b/src/map/ENC/rastertile.cpp index 6a06634a..51fb8cfc 100644 --- a/src/map/ENC/rastertile.cpp +++ b/src/map/ENC/rastertile.cpp @@ -265,7 +265,8 @@ void RasterTile::processPolygons(const QList &polygons, TextPointItem *item = new TextPointItem( ll2xy(centroid(poly.path().first())).toPoint(), label, fnt, img, color, hColor, 0, 0); - if (item->isValid() && !item->collides(textItems)) + if (item->isValid() && _rect.contains(item->boundingRect().toRect()) + && !item->collides(textItems)) textItems.append(item); else delete item; @@ -391,8 +392,8 @@ void RasterTile::render() fetchData(polygons, lines, points); - processPolygons(polygons, textItems); processPoints(points, textItems, lights); + processPolygons(polygons, textItems); processLines(lines, textItems); QPainter painter(&img);