diff options
Diffstat (limited to 'src/mbgl/map')
-rw-r--r-- | src/mbgl/map/map.cpp | 12 | ||||
-rw-r--r-- | src/mbgl/map/transform.cpp | 4 |
2 files changed, 8 insertions, 8 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; diff --git a/src/mbgl/map/transform.cpp b/src/mbgl/map/transform.cpp index 67729f7fe2..f9a687480c 100644 --- a/src/mbgl/map/transform.cpp +++ b/src/mbgl/map/transform.cpp @@ -200,8 +200,8 @@ void Transform::flyTo(const CameraOptions &camera, const AnimationOptions &anima /// w₀: Initial visible span, measured in pixels at the initial scale. /// Known henceforth as a <i>screenful</i>. - double w0 = std::max(state.size.width - padding.left - padding.right, - state.size.height - padding.top - padding.bottom); + double w0 = std::max(state.size.width - padding.left() - padding.right(), + state.size.height - padding.top() - padding.bottom()); /// w₁: Final visible span, measured in pixels with respect to the initial /// scale. double w1 = w0 / state.zoomScale(zoom - startZoom); |