summaryrefslogtreecommitdiff
path: root/src/location/maps/qgeocameratiles.cpp
diff options
context:
space:
mode:
authorMichal Klocek <michal.klocek@theqtcompany.com>2015-04-28 12:10:16 +0200
committerMichal Klocek <michal.klocek@theqtcompany.com>2015-05-21 08:13:12 +0000
commit52b887a8004029cf18942b5d16b1dcf396feabc0 (patch)
treef2d44efd150ce1deb413d7cd1eccdbd1547e76be /src/location/maps/qgeocameratiles.cpp
parentc40da252cf5ccdc5b5d2ce30b0f7f272e3d1c5bf (diff)
downloadqtlocation-52b887a8004029cf18942b5d16b1dcf396feabc0.tar.gz
Unify zoom calculations
Make camera calculations in qgeocameratiles and qgeomapscene more obvious. Use the same fractions. Change-Id: I4f156bb894eb2c606df97308ebd1b637408d9f2d Reviewed-by: Alex Blasche <alexander.blasche@theqtcompany.com>
Diffstat (limited to 'src/location/maps/qgeocameratiles.cpp')
-rw-r--r--src/location/maps/qgeocameratiles.cpp5
1 files changed, 2 insertions, 3 deletions
diff --git a/src/location/maps/qgeocameratiles.cpp b/src/location/maps/qgeocameratiles.cpp
index 8023adcd..33c140ee 100644
--- a/src/location/maps/qgeocameratiles.cpp
+++ b/src/location/maps/qgeocameratiles.cpp
@@ -322,9 +322,9 @@ Frustum QGeoCameraTilesPrivate::createFrustum(double fieldOfViewGradient) const
QDoubleVector3D center = m_sideLength * QGeoProjection::coordToMercator(m_camera.center());
center.setZ(0.0);
- double f = qMin(m_screenSize.width(), m_screenSize.height()) / (1.0 * m_tileSize);
+ double f = qMin(m_screenSize.width(), m_screenSize.height());
- double z = std::pow(2.0, m_camera.zoomLevel() - m_intZoomLevel);
+ double z = std::pow(2.0, m_camera.zoomLevel() - m_intZoomLevel) * m_tileSize;
double altitude = f / (2.0 * z);
QDoubleVector3D eye = center;
@@ -337,7 +337,6 @@ Frustum QGeoCameraTilesPrivate::createFrustum(double fieldOfViewGradient) const
double nearPlane = 1 / (4.0 * m_tileSize );
double farPlane = altitude + 1.0;
-
double aspectRatio = 1.0 * m_screenSize.width() / m_screenSize.height();
double hn,wn,hf,wf = 0.0;