diff options
Diffstat (limited to 'src/mbgl/map/transform_state.cpp')
-rw-r--r-- | src/mbgl/map/transform_state.cpp | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/src/mbgl/map/transform_state.cpp b/src/mbgl/map/transform_state.cpp index 554a72cf4a..778d4bd7e7 100644 --- a/src/mbgl/map/transform_state.cpp +++ b/src/mbgl/map/transform_state.cpp @@ -375,12 +375,9 @@ void TransformState::constrain(double& scale_, double& x_, double& y_) const { return; } - const double ratioX = (rotatedNorth() ? size.height : size.width) / util::tileSize; + // Constrain scale to avoid zooming out far enough to show off-world areas on the Y axis. const double ratioY = (rotatedNorth() ? size.width : size.height) / util::tileSize; - - // Constrain minimum scale to avoid zooming out far enough to show off-world areas on the Y axis. - // If Y axis ratio is too small to be constrained, use X axis ratio instead. - scale_ = util::max(scale_, ratioY < 1.0 ? ratioX : ratioY); + scale_ = util::max(scale_, ratioY); // Constrain min/max pan to avoid showing off-world areas on the Y axis. double max_y = (scale_ * util::tileSize - (rotatedNorth() ? size.width : size.height)) / 2; |