diff options
author | Ansis Brammanis <brammanis@gmail.com> | 2015-04-30 16:03:35 -0700 |
---|---|---|
committer | Ansis Brammanis <brammanis@gmail.com> | 2015-04-30 16:03:35 -0700 |
commit | ed9ef0f7d127c0deeeeaeec548f7daf6eecf57de (patch) | |
tree | 772e829f2dc95010e90d746517e2dea5e04b0bbd | |
parent | c69e985fa5f739b06c0e8668ec06c3a72cb094e1 (diff) | |
download | qtlocation-mapboxgl-ed9ef0f7d127c0deeeeaeec548f7daf6eecf57de.tar.gz |
fix pixelForLatLng during animated zoom
fix #1160
-rw-r--r-- | src/mbgl/map/transform.cpp | 10 |
1 files 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, |