mirror of
https://github.com/tumic0/GPXSee.git
synced 2024-11-24 03:35:53 +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,
|
void RasterTile::drawTextItems(QPainter *painter,
|
||||||
const QList<TextItem*> &textItems)
|
const QList<TextItem*> &textItems)
|
||||||
{
|
{
|
||||||
for (int i = 0; i < textItems.size(); i++)
|
QRectF rect(_rect);
|
||||||
textItems.at(i)->paint(painter);
|
|
||||||
|
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,
|
void RasterTile::processPolygons(const QList<MapData::Poly> &polygons,
|
||||||
|
@ -217,8 +217,13 @@ void RasterTile::drawLines(QPainter *painter,
|
|||||||
void RasterTile::drawTextItems(QPainter *painter,
|
void RasterTile::drawTextItems(QPainter *painter,
|
||||||
const QList<TextItem*> &textItems) const
|
const QList<TextItem*> &textItems) const
|
||||||
{
|
{
|
||||||
for (int i = 0; i < textItems.size(); i++)
|
QRectF rect(_rect);
|
||||||
textItems.at(i)->paint(painter);
|
|
||||||
|
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,
|
static void removeDuplicitLabel(QList<TextItem *> &labels, const QString &text,
|
||||||
|
Loading…
Reference in New Issue
Block a user