diff --git a/src/map/ENC/rastertile.cpp b/src/map/ENC/rastertile.cpp index 8558d37c..dcba0978 100644 --- a/src/map/ENC/rastertile.cpp +++ b/src/map/ENC/rastertile.cpp @@ -220,8 +220,13 @@ void RasterTile::drawLines(QPainter *painter, const QList &lines) void RasterTile::drawTextItems(QPainter *painter, const QList &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); + } } void RasterTile::processPolygons(const QList &polygons, diff --git a/src/map/IMG/rastertile.cpp b/src/map/IMG/rastertile.cpp index 634aaea1..7425cada 100644 --- a/src/map/IMG/rastertile.cpp +++ b/src/map/IMG/rastertile.cpp @@ -217,8 +217,13 @@ void RasterTile::drawLines(QPainter *painter, void RasterTile::drawTextItems(QPainter *painter, const QList &textItems) const { - 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); + } } static void removeDuplicitLabel(QList &labels, const QString &text,