Skip to content

Commit

Permalink
Do not try to draw labels outside the tile rect
Browse files Browse the repository at this point in the history
  • Loading branch information
tumic0 committed Nov 22, 2024
1 parent 62ae50e commit 85fd574
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/map/mapsforge/rastertile.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -231,8 +231,13 @@ void RasterTile::processLineLabels(const QVector<PainterPath> &paths,
void RasterTile::drawTextItems(QPainter *painter,
const QList<TextItem*> &textItems)
{
for (int i = 0; i < textItems.size(); i++)
textItems.at(i)->paint(painter);
QRectF rect(_rect);

for (int i = 0; i < textItems.size(); i++) {
const TextItem *ti = textItems.at(i);
if (rect.intersects(ti->boundingRect()))
ti->paint(painter);
}
}

QPainterPath RasterTile::painterPath(const Polygon &polygon, bool curve) const
Expand Down

0 comments on commit 85fd574

Please sign in to comment.