summaryrefslogtreecommitdiff
path: root/src/mbgl/map/map.cpp
diff options
context:
space:
mode:
authorBruno de Oliveira Abinader <bruno@mapbox.com>2017-04-11 17:07:25 +0300
committerJohn Firebaugh <john.firebaugh@gmail.com>2017-04-14 12:33:13 -0700
commit2f4d162debd7e4accfc0b20360058304dce40801 (patch)
tree276894e2ccfa67874dbe6ecf263330d6b35007ad /src/mbgl/map/map.cpp
parent8877452ec36d01a753221998f31b67700e595d54 (diff)
downloadqtlocation-mapboxgl-2f4d162debd7e4accfc0b20360058304dce40801.tar.gz
[core] Tighten geo.hpp ctors
Diffstat (limited to 'src/mbgl/map/map.cpp')
-rw-r--r--src/mbgl/map/map.cpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/mbgl/map/map.cpp b/src/mbgl/map/map.cpp
index 19b1222f0e..fde466054c 100644
--- a/src/mbgl/map/map.cpp
+++ b/src/mbgl/map/map.cpp
@@ -600,8 +600,8 @@ CameraOptions Map::cameraForLatLngs(const std::vector<LatLng>& latLngs, const Ed
if (width > 0 || height > 0) {
double scaleX = double(getSize().width) / width;
double scaleY = double(getSize().height) / height;
- scaleX -= (padding.left + padding.right) / width;
- scaleY -= (padding.top + padding.bottom) / height;
+ scaleX -= (padding.left() + padding.right()) / width;
+ scaleY -= (padding.top() + padding.bottom()) / height;
minScale = util::min(scaleX, scaleY);
}
double zoom = getZoom() + util::log2(minScale);
@@ -610,12 +610,12 @@ CameraOptions Map::cameraForLatLngs(const std::vector<LatLng>& latLngs, const Ed
// Calculate the center point of a virtual bounds that is extended in all directions by padding.
ScreenCoordinate centerPixel = nePixel + swPixel;
ScreenCoordinate paddedNEPixel = {
- padding.right / minScale,
- padding.top / minScale,
+ padding.right() / minScale,
+ padding.top() / minScale,
};
ScreenCoordinate paddedSWPixel = {
- padding.left / minScale,
- padding.bottom / minScale,
+ padding.left() / minScale,
+ padding.bottom() / minScale,
};
centerPixel = centerPixel + paddedNEPixel - paddedSWPixel;
centerPixel /= 2.0;