summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTorsten Rahn <rahn@kde.org>2016-11-12 09:36:03 (GMT)
committerDennis Nienhüser <nienhueser@kde.org>2016-11-12 09:38:18 (GMT)
commit0621ff5286d3e511fb9d630b9576eb04c0783c95 (patch)
treed98d0d3ef91e06db03bbd1cb905a17c352a4884c
parent45f9db6dcdc7a3a9415eb0d643ae4ebbf96cd123 (diff)
Take screen size into account when adjusting tile zoom level.
-rw-r--r--src/lib/marble/layers/VectorTileLayer.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/lib/marble/layers/VectorTileLayer.cpp b/src/lib/marble/layers/VectorTileLayer.cpp
index 35159e1..6ce58a0 100644
--- a/src/lib/marble/layers/VectorTileLayer.cpp
+++ b/src/lib/marble/layers/VectorTileLayer.cpp
@@ -161,8 +161,11 @@ bool VectorTileLayer::render( GeoPainter *painter, ViewportParams *viewport,
int const oldLevel = tileZoomLevel();
int level = 0;
+ qreal const referenceArea = 1600.0 * 1200.0;
+ qreal const screenArea = viewport->width() * viewport->height();
+ qreal const adjustedRadius = viewport->radius() * referenceArea / screenArea;
foreach ( VectorTileModel *mapper, d->m_activeTexmappers ) {
- mapper->setViewport( viewport->viewLatLonAltBox(), viewport->radius() );
+ mapper->setViewport( viewport->viewLatLonAltBox(), adjustedRadius );
level = qMax(level, mapper->tileZoomLevel());
}
if (oldLevel != level) {