mirror of
https://github.com/tumic0/GPXSee.git
synced 2024-11-24 03:35:53 +01:00
Fixed broken PDF/PNG export of MApsforge maps
This commit is contained in:
parent
c3ba8f1f0d
commit
e701ad0ed0
@ -164,8 +164,6 @@ void MapsforgeMap::cancelJobs()
|
|||||||
|
|
||||||
void MapsforgeMap::draw(QPainter *painter, const QRectF &rect, Flags flags)
|
void MapsforgeMap::draw(QPainter *painter, const QRectF &rect, Flags flags)
|
||||||
{
|
{
|
||||||
Q_UNUSED(flags);
|
|
||||||
|
|
||||||
QPointF tl(floor(rect.left() / _data.tileSize()) * _data.tileSize(),
|
QPointF tl(floor(rect.left() / _data.tileSize()) * _data.tileSize(),
|
||||||
floor(rect.top() / _data.tileSize()) * _data.tileSize());
|
floor(rect.top() / _data.tileSize()) * _data.tileSize());
|
||||||
QSizeF s(rect.right() - tl.x(), rect.bottom() - tl.y());
|
QSizeF s(rect.right() - tl.x(), rect.bottom() - tl.y());
|
||||||
@ -215,8 +213,20 @@ void MapsforgeMap::draw(QPainter *painter, const QRectF &rect, Flags flags)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!tiles.isEmpty())
|
if (!tiles.isEmpty()) {
|
||||||
runJob(new MapsforgeMapJob(tiles));
|
if (flags & Map::Block) {
|
||||||
|
QFuture<void> future = QtConcurrent::map(tiles, &RasterTile::render);
|
||||||
|
future.waitForFinished();
|
||||||
|
|
||||||
|
for (int i = 0; i < tiles.size(); i++) {
|
||||||
|
const RasterTile &mt = tiles.at(i);
|
||||||
|
const QPixmap &pm = mt.pixmap();
|
||||||
|
painter->drawPixmap(mt.xy(), pm);
|
||||||
|
QPixmapCache::insert(key(mt.zoom(), mt.xy()), pm);
|
||||||
|
}
|
||||||
|
} else
|
||||||
|
runJob(new MapsforgeMapJob(tiles));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void MapsforgeMap::setDevicePixelRatio(qreal deviceRatio, qreal mapRatio)
|
void MapsforgeMap::setDevicePixelRatio(qreal deviceRatio, qreal mapRatio)
|
||||||
|
Loading…
Reference in New Issue
Block a user