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:
parent
2a16a1f34c
commit
67820d7c4d
@ -220,8 +220,13 @@ void RasterTile::drawLines(QPainter *painter, const QList<MapData::Line> &lines)
|
||||
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);
|
||||
}
|
||||
}
|
||||
|
||||
void RasterTile::processPolygons(const QList<MapData::Poly> &polygons,
|
||||
|
@ -217,8 +217,13 @@ void RasterTile::drawLines(QPainter *painter,
|
||||
void RasterTile::drawTextItems(QPainter *painter,
|
||||
const QList<TextItem*> &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<TextItem *> &labels, const QString &text,
|
||||
|
Loading…
Reference in New Issue
Block a user