mirror of
https://github.com/tumic0/GPXSee.git
synced 2024-11-30 22:51:16 +01:00
Compare commits
No commits in common. "e701ad0ed0f2f5162b32ff37fa7570cbe8cc0be0" and "b98143ef8ce91ef19fbe5928301d337c463a19db" have entirely different histories.
e701ad0ed0
...
b98143ef8c
@ -726,7 +726,7 @@ void MapView::plot(QPainter *painter, const QRectF &target, qreal scale,
|
|||||||
PlotFlags flags)
|
PlotFlags flags)
|
||||||
{
|
{
|
||||||
QRect orig, adj;
|
QRect orig, adj;
|
||||||
qreal mapRatio, ratio, diff, q, p;
|
qreal ratio, diff, q, p;
|
||||||
QPointF scenePos, scalePos, posPos, motionPos;
|
QPointF scenePos, scalePos, posPos, motionPos;
|
||||||
int zoom;
|
int zoom;
|
||||||
|
|
||||||
@ -734,6 +734,7 @@ void MapView::plot(QPainter *painter, const QRectF &target, qreal scale,
|
|||||||
// Enter plot mode
|
// Enter plot mode
|
||||||
setUpdatesEnabled(false);
|
setUpdatesEnabled(false);
|
||||||
_plot = true;
|
_plot = true;
|
||||||
|
_map->setDevicePixelRatio(_deviceRatio, 1.0);
|
||||||
|
|
||||||
// Compute sizes & ratios
|
// Compute sizes & ratios
|
||||||
orig = viewport()->rect();
|
orig = viewport()->rect();
|
||||||
@ -752,9 +753,6 @@ void MapView::plot(QPainter *painter, const QRectF &target, qreal scale,
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Expand the view if plotting into a bitmap
|
// Expand the view if plotting into a bitmap
|
||||||
mapRatio = _mapRatio;
|
|
||||||
setDevicePixelRatio(_deviceRatio, 1.0);
|
|
||||||
|
|
||||||
if (flags & Expand) {
|
if (flags & Expand) {
|
||||||
qreal xdiff = (target.width() - adj.width()) / 2.0;
|
qreal xdiff = (target.width() - adj.width()) / 2.0;
|
||||||
qreal ydiff = (target.height() - adj.height()) / 2.0;
|
qreal ydiff = (target.height() - adj.height()) / 2.0;
|
||||||
@ -807,9 +805,6 @@ void MapView::plot(QPainter *painter, const QRectF &target, qreal scale,
|
|||||||
rescale();
|
rescale();
|
||||||
centerOn(scenePos);
|
centerOn(scenePos);
|
||||||
}
|
}
|
||||||
|
|
||||||
setDevicePixelRatio(_deviceRatio, mapRatio);
|
|
||||||
|
|
||||||
_mapScale->setDigitalZoom(_digitalZoom);
|
_mapScale->setDigitalZoom(_digitalZoom);
|
||||||
_mapScale->setPos(scalePos);
|
_mapScale->setPos(scalePos);
|
||||||
_positionCoordinates->setDigitalZoom(_digitalZoom);
|
_positionCoordinates->setDigitalZoom(_digitalZoom);
|
||||||
@ -818,6 +813,7 @@ void MapView::plot(QPainter *painter, const QRectF &target, qreal scale,
|
|||||||
_motionInfo->setPos(motionPos);
|
_motionInfo->setPos(motionPos);
|
||||||
|
|
||||||
// Exit plot mode
|
// Exit plot mode
|
||||||
|
_map->setDevicePixelRatio(_deviceRatio, _mapRatio);
|
||||||
_plot = false;
|
_plot = false;
|
||||||
setUpdatesEnabled(true);
|
setUpdatesEnabled(true);
|
||||||
}
|
}
|
||||||
|
@ -164,6 +164,8 @@ 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());
|
||||||
@ -213,21 +215,9 @@ void MapsforgeMap::draw(QPainter *painter, const QRectF &rect, Flags flags)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!tiles.isEmpty()) {
|
if (!tiles.isEmpty())
|
||||||
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));
|
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