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:
parent
ee20b02dfa
commit
fb0c8c8b76
@ -161,7 +161,6 @@ void RasterTile::processAreaLabels(const QVector<PainterPath> &paths,
|
|||||||
QList<const Style::TextRender*> labels(_style->areaLabels(_zoom));
|
QList<const Style::TextRender*> labels(_style->areaLabels(_zoom));
|
||||||
QList<const Style::Symbol*> symbols(_style->areaSymbols(_zoom));
|
QList<const Style::Symbol*> symbols(_style->areaSymbols(_zoom));
|
||||||
QList<PathText> items;
|
QList<PathText> items;
|
||||||
QSet<QByteArray> set;
|
|
||||||
|
|
||||||
for (int i = 0; i < paths.size(); i++) {
|
for (int i = 0; i < paths.size(); i++) {
|
||||||
const PainterPath &path = paths.at(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()
|
QPointF pos = p.p->path->labelPos.isNull()
|
||||||
? centroid(p.p->pp) : ll2xy(p.p->path->labelPos);
|
? 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,
|
PointItem *item = new PointItem(pos.toPoint(), p.lbl, font, img, color,
|
||||||
hColor);
|
hColor);
|
||||||
if (item->isValid() && rectNearPolygon(p.p->pp, item->boundingRect())
|
if (item->isValid() && rectNearPolygon(p.p->pp, item->boundingRect())
|
||||||
&& !item->collides(textItems)) {
|
&& !item->collides(textItems))
|
||||||
textItems.append(item);
|
textItems.append(item);
|
||||||
if (p.ti && p.lbl)
|
else
|
||||||
set.insert(*p.lbl);
|
|
||||||
} else
|
|
||||||
delete item;
|
delete item;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user