1
0
mirror of https://github.com/tumic0/GPXSee.git synced 2024-11-24 11:45:53 +01:00

Code cleanup

This commit is contained in:
Martin Tůma 2021-09-28 12:47:14 +02:00
parent ce5a924e8f
commit 2d5cf5478a

View File

@ -155,8 +155,9 @@ void IMGMap::draw(QPainter *painter, const QRectF &rect, Flags flags)
for (int j = 0; j < height; j++) { for (int j = 0; j < height; j++) {
QPixmap pm; QPixmap pm;
QPoint ttl(tl.x() + i * TILE_SIZE, tl.y() + j * TILE_SIZE); QPoint ttl(tl.x() + i * TILE_SIZE, tl.y() + j * TILE_SIZE);
QString key = _data.at(n)->fileName() + "-" + QString::number(_zoom) QString key(_data.at(n)->fileName() + "-" + QString::number(_zoom)
+ "_" + QString::number(ttl.x()) + "_" + QString::number(ttl.y()); + "_" + QString::number(ttl.x()) + "_" + QString::number(ttl.y()));
if (QPixmapCache::find(key, &pm)) if (QPixmapCache::find(key, &pm))
painter->drawPixmap(ttl, pm); painter->drawPixmap(ttl, pm);
else { else {
@ -192,11 +193,8 @@ void IMGMap::draw(QPainter *painter, const QRectF &rect, Flags flags)
future.waitForFinished(); future.waitForFinished();
for (int i = 0; i < tiles.size(); i++) { for (int i = 0; i < tiles.size(); i++) {
RasterTile &mt = tiles[i]; const RasterTile &mt = tiles.at(i);
const QPixmap &pm = mt.pixmap(); const QPixmap &pm = mt.pixmap();
if (pm.isNull())
continue;
painter->drawPixmap(mt.xy(), pm); painter->drawPixmap(mt.xy(), pm);
QPixmapCache::insert(mt.key(), pm); QPixmapCache::insert(mt.key(), pm);
} }