1
0
mirror of https://github.com/tumic0/GPXSee.git synced 2024-11-28 05:34:47 +01:00

Remove the right item from the list

This commit is contained in:
Martin Tůma 2020-10-17 20:59:58 +02:00
parent 7babf734bf
commit e4d7f45103

View File

@ -240,10 +240,10 @@ void RasterTile::drawTextItems(QPainter *painter,
static void removeDuplicitLabel(QList<TextItem *> &labels, const QString &text, static void removeDuplicitLabel(QList<TextItem *> &labels, const QString &text,
const QRectF &tileRect) const QRectF &tileRect)
{ {
for (int j = 0; j < labels.size(); j++) { for (int i = 0; i < labels.size(); i++) {
TextItem *item = labels.at(j); TextItem *item = labels.at(i);
if (tileRect.contains(item->boundingRect()) && *(item->text()) == text) { if (tileRect.contains(item->boundingRect()) && *(item->text()) == text) {
labels.removeOne(item); labels.removeAt(i);
delete item; delete item;
return; return;
} }