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

Fix cut-off labels

This commit is contained in:
Martin Tůma 2024-06-18 18:43:54 +02:00
parent ef7b863003
commit 7a9e4171f9

View File

@ -265,7 +265,8 @@ void RasterTile::processPolygons(const QList<MapData::Poly> &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);