mirror of
https://github.com/tumic0/GPXSee.git
synced 2024-11-24 19:55:53 +01:00
Code cleanup
This commit is contained in:
parent
c1a217847f
commit
b6e9400392
@ -284,23 +284,24 @@ void MBTilesMap::draw(QPainter *painter, const QRectF &rect, Flags flags)
|
||||
for (int i = 0; i < tiles.size(); i++) {
|
||||
const MBTile &mt = tiles.at(i);
|
||||
QPixmap pm(mt.pixmap());
|
||||
if (!pm.isNull())
|
||||
QPixmapCache::insert(mt.key(), pm);
|
||||
if (pm.isNull())
|
||||
continue;
|
||||
|
||||
QPointF tp(qMax(tl.x(), b.left()) + (mt.xy().x() - tile.x()) * tileSize(),
|
||||
qMax(tl.y(), b.top()) + (mt.xy().y() - tile.y()) * tileSize());
|
||||
QPixmapCache::insert(mt.key(), pm);
|
||||
|
||||
QPointF tp(qMax(tl.x(), b.left()) + (mt.xy().x() - tile.x())
|
||||
* tileSize(), qMax(tl.y(), b.top()) + (mt.xy().y() - tile.y())
|
||||
* tileSize());
|
||||
drawTile(painter, pm, tp);
|
||||
}
|
||||
}
|
||||
|
||||
void MBTilesMap::drawTile(QPainter *painter, QPixmap &pixmap, QPointF &tp)
|
||||
{
|
||||
if (!pixmap.isNull()) {
|
||||
#ifdef ENABLE_HIDPI
|
||||
pixmap.setDevicePixelRatio(imageRatio());
|
||||
pixmap.setDevicePixelRatio(imageRatio());
|
||||
#endif // ENABLE_HIDPI
|
||||
painter->drawPixmap(tp, pixmap);
|
||||
}
|
||||
painter->drawPixmap(tp, pixmap);
|
||||
}
|
||||
|
||||
QPointF MBTilesMap::ll2xy(const Coordinates &c)
|
||||
|
Loading…
Reference in New Issue
Block a user