summaryrefslogtreecommitdiff
path: root/src/location/maps/qgeotiledmap.cpp
diff options
context:
space:
mode:
authorPaolo Angelelli <paolo.angelelli@qt.io>2016-11-18 19:02:36 +0100
committerPaolo Angelelli <paolo.angelelli@qt.io>2016-11-22 09:28:38 +0000
commit95f8804ecaed79792a57b1fe3580266bfbbf7590 (patch)
tree43c53b67a32deaf4635b13a544d480a241775fa0 /src/location/maps/qgeotiledmap.cpp
parent81b42ba2508241cdeeecdbcdac6f1d22be922022 (diff)
downloadqtlocation-95f8804ecaed79792a57b1fe3580266bfbbf7590.tar.gz
Renaming QGeoMapPrivate::changeMapSize to changeViewportSize
The current name of this method generate confusion, as what it does is changing the size of the final element in the application, and not the actual map size. This patch renames this method to changeDisplaySize It also renames QGeoMap::setSize to setViewportSize, as well as ::size to viewportSize , width to viewportWidth and height to viewportHeight, to make everything consistent and self-explanatory. Finally it also renames minimumZoomAtMapSize to minimumZoomAtViewportSize. Change-Id: I7c1ca8bb3ca3d6f6b0fe6fc881b9300db7110527 Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
Diffstat (limited to 'src/location/maps/qgeotiledmap.cpp')
-rw-r--r--src/location/maps/qgeotiledmap.cpp14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/location/maps/qgeotiledmap.cpp b/src/location/maps/qgeotiledmap.cpp
index fedaecbc..04f9ad21 100644
--- a/src/location/maps/qgeotiledmap.cpp
+++ b/src/location/maps/qgeotiledmap.cpp
@@ -142,8 +142,8 @@ QGeoCoordinate QGeoTiledMap::itemPositionToCoordinate(const QDoubleVector2D &pos
{
Q_D(const QGeoTiledMap);
if (clipToViewport) {
- int w = width();
- int h = height();
+ int w = viewportWidth();
+ int h = viewportHeight();
if ((pos.x() < 0) || (w < pos.x()) || (pos.y() < 0) || (h < pos.y()))
return QGeoCoordinate();
@@ -158,8 +158,8 @@ QDoubleVector2D QGeoTiledMap::coordinateToItemPosition(const QGeoCoordinate &coo
QDoubleVector2D pos = d->coordinateToItemPosition(coordinate);
if (clipToViewport) {
- int w = width();
- int h = height();
+ int w = viewportWidth();
+ int h = viewportHeight();
double x = pos.x();
double y = pos.y();
if ((x < 0.0) || (x > w) || (y < 0) || (y > h) || qIsNaN(x) || qIsNaN(y))
@@ -171,7 +171,7 @@ QDoubleVector2D QGeoTiledMap::coordinateToItemPosition(const QGeoCoordinate &coo
// This method returns the minimum zoom level that this specific qgeomap type allows
// at a given canvas size (width,height) and for a given tile size (usually 256).
-double QGeoTiledMap::minimumZoomAtMapSize(int width, int height) const
+double QGeoTiledMap::minimumZoomAtViewportSize(int width, int height) const
{
Q_D(const QGeoTiledMap);
double maxSize = qMax(width,height);
@@ -192,7 +192,7 @@ double QGeoTiledMap::maximumCenterLatitudeAtZoom(double zoomLevel) const
mapEdgeSize *= d->m_visibleTiles->tileSize();
// At init time weird things happen
- int clampedWindowHeight = (height() > mapEdgeSize) ? mapEdgeSize : height();
+ int clampedWindowHeight = (viewportHeight() > mapEdgeSize) ? mapEdgeSize : viewportHeight();
// Use the window height divided by 2 as the topmost allowed center, with respect to the map size in pixels
double mercatorTopmost = (clampedWindowHeight * 0.5) / mapEdgeSize ;
@@ -375,7 +375,7 @@ void QGeoTiledMapPrivate::clearScene()
updateScene();
}
-void QGeoTiledMapPrivate::changeMapSize(const QSize& size)
+void QGeoTiledMapPrivate::changeViewportSize(const QSize& size)
{
Q_Q(QGeoTiledMap);