summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDennis Nienhüser <nienhueser@kde.org>2016-11-12 15:40:00 (GMT)
committerDennis Nienhüser <nienhueser@kde.org>2016-11-12 15:40:00 (GMT)
commitacd2d10b552f393578766cbe02013073ab2074bf (patch)
treef5c966172a55bf9dcad57e1caa89a809715cad79
parent926082c918cc2a0824c550efb2d1d157e9f9a3f5 (diff)
Fix average calculation for n > 1 :-P
-rw-r--r--src/lib/marble/layers/VectorTileLayer.cpp7
1 files changed, 3 insertions, 4 deletions
diff --git a/src/lib/marble/layers/VectorTileLayer.cpp b/src/lib/marble/layers/VectorTileLayer.cpp
index 8c4ff7d..cc709b0 100644
--- a/src/lib/marble/layers/VectorTileLayer.cpp
+++ b/src/lib/marble/layers/VectorTileLayer.cpp
@@ -123,12 +123,11 @@ VectorTileLayer::VectorTileLayer(HttpDownloadManager *downloadManager,
d->m_averageScreenArea = 0;
foreach (QScreen *screen, QGuiApplication::screens()) {
- qDebug() << screen->availableSize().width() << screen->availableSize().height();
d->m_averageScreenArea += screen->availableSize().width() * screen->availableSize().height();
}
- if (d->m_averageScreenArea < 786432) {
- d->m_averageScreenArea = 786432; // any screen size lower than 1024x768 is treated as 1024x768
- }
+ d->m_averageScreenArea /= qMax(1, QGuiApplication::screens().size());
+ // any screen size lower than 1024x768 is treated as 1024x768
+ d->m_averageScreenArea = qMax(1024*768, d->m_averageScreenArea);
}
VectorTileLayer::~VectorTileLayer()