Skip to content

Commit

Permalink
Yet another area labels layout algorithm change
Browse files Browse the repository at this point in the history
  • Loading branch information
tumic0 committed Nov 13, 2024
1 parent 1a9bec1 commit a992791
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions src/map/mapsforge/rastertile.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -205,17 +205,14 @@ void RasterTile::processAreaLabels(const QVector<PainterPath> &paths,
const QColor *color = p.ti ? &p.ti->fillColor() : 0;
const QColor *hColor = p.ti ? haloColor(p.ti) : 0;

QPainterPath rp;
rp.addRect(_rect);
QPointF pos = p.p->path->labelPos.isNull()
? centroid(p.p->pp & rp) : 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,
hColor);
if (item->isValid() && _rect.contains(item->boundingRect().toRect())
&& rectNearPolygon(p.p->pp, item->boundingRect())
if (item->isValid() && rectNearPolygon(p.p->pp, item->boundingRect())
&& !item->collides(textItems)) {
textItems.append(item);
if (p.ti && p.lbl)
Expand Down

0 comments on commit a992791

Please sign in to comment.