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

Area labels layout/clip fix

This commit is contained in:
Martin Tůma 2024-11-17 18:16:43 +01:00
parent ee20b02dfa
commit fb0c8c8b76

View File

@ -161,7 +161,6 @@ void RasterTile::processAreaLabels(const QVector<PainterPath> &paths,
QList<const Style::TextRender*> labels(_style->areaLabels(_zoom));
QList<const Style::Symbol*> symbols(_style->areaSymbols(_zoom));
QList<PathText> items;
QSet<QByteArray> set;
for (int i = 0; i < paths.size(); i++) {
const PainterPath &path = paths.at(i);
@ -207,17 +206,12 @@ void RasterTile::processAreaLabels(const QVector<PainterPath> &paths,
QPointF pos = p.p->path->labelPos.isNull()
? centroid(p.p->pp) : ll2xy(p.p->path->labelPos);
if (p.ti && p.lbl && set.contains(*p.lbl))
continue;
PointItem *item = new PointItem(pos.toPoint(), p.lbl, font, img, color,
hColor);
if (item->isValid() && rectNearPolygon(p.p->pp, item->boundingRect())
&& !item->collides(textItems)) {
&& !item->collides(textItems))
textItems.append(item);
if (p.ti && p.lbl)
set.insert(*p.lbl);
} else
else
delete item;
}
}