From ed9ef0f7d127c0deeeeaeec548f7daf6eecf57de Mon Sep 17 00:00:00 2001 From: Ansis Brammanis Date: Thu, 30 Apr 2015 16:03:35 -0700 Subject: fix pixelForLatLng during animated zoom fix #1160 --- src/mbgl/map/transform.cpp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/mbgl/map/transform.cpp b/src/mbgl/map/transform.cpp index cb73915e36..6c0f136a6b 100644 --- a/src/mbgl/map/transform.cpp +++ b/src/mbgl/map/transform.cpp @@ -238,6 +238,9 @@ void Transform::_setScaleXY(const double new_scale, const double xn, const doubl current.scale = final.scale; current.x = final.x; current.y = final.y; + const double s = current.scale * util::tileSize; + current.Bc = s / 360; + current.Cc = s / util::M2PI; } else { const double startS = current.scale; const double startX = current.x; @@ -250,6 +253,9 @@ void Transform::_setScaleXY(const double new_scale, const double xn, const doubl current.scale = util::interpolate(startS, final.scale, t); current.x = util::interpolate(startX, final.x, t); current.y = util::interpolate(startY, final.y, t); + const double s = current.scale * util::tileSize; + current.Bc = s / 360; + current.Cc = s / util::M2PI; return Update::Zoom; }, [=] { @@ -258,10 +264,6 @@ void Transform::_setScaleXY(const double new_scale, const double xn, const doubl }, duration); } - const double s = final.scale * util::tileSize; - current.Bc = s / 360; - current.Cc = s / util::M2PI; - view.notifyMapChange(duration != Duration::zero() ? MapChangeRegionDidChangeAnimated : MapChangeRegionDidChange, -- cgit v1.2.1