[core] Clamp to scale boundaries in TransformState::setLatLngZoom

This commit is contained in:
Bruno de Oliveira Abinader
2017-06-28 14:23:39 +03:00
parent a35b268606
commit 433e54e636
2 changed files with 17 additions and 1 deletions

View File

@@ -358,7 +358,7 @@ void TransformState::setLatLngZoom(const LatLng& latLng, double zoom) {
constrained = bounds->constrain(latLng);
}
double newScale = zoomScale(zoom);
double newScale = util::clamp(zoomScale(zoom), min_scale, max_scale);
const double newWorldSize = newScale * util::tileSize;
Bc = newWorldSize / util::DEGREES_MAX;
Cc = newWorldSize / util::M2PI;