diff options
Diffstat (limited to 'src/mbgl/map/map.cpp')
-rw-r--r-- | src/mbgl/map/map.cpp | 12 |
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; |