1
0
mirror of https://github.com/tumic0/GPXSee.git synced 2024-11-23 19:25:54 +01:00

Do not try to draw labels outside the tile rect

This commit is contained in:
Martin Tůma 2024-11-22 20:45:43 +01:00
parent 62ae50ecda
commit 85fd574b38

View File

@ -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