summaryrefslogtreecommitdiff
path: root/src/mbgl/map
diff options
context:
space:
mode:
Diffstat (limited to 'src/mbgl/map')
-rw-r--r--src/mbgl/map/transform.cpp11
1 files changed, 5 insertions, 6 deletions
diff --git a/src/mbgl/map/transform.cpp b/src/mbgl/map/transform.cpp
index e360150cc2..4004b29431 100644
--- a/src/mbgl/map/transform.cpp
+++ b/src/mbgl/map/transform.cpp
@@ -112,7 +112,6 @@ void Transform::easeTo(const CameraOptions& camera, const AnimationOptions& anim
// Constrain camera options.
zoom = util::clamp(zoom, state.getMinZoom(), state.getMaxZoom());
- const double scale = state.zoomScale(zoom);
pitch = util::clamp(pitch, util::PITCH_MIN, util::PITCH_MAX);
// Minimize rotation by taking the shorter path around the circle.
@@ -121,19 +120,19 @@ void Transform::easeTo(const CameraOptions& camera, const AnimationOptions& anim
Duration duration = animation.duration ? *animation.duration : Duration::zero();
- const double startScale = state.scale;
+ const double startZoom = state.getZoom();
const double startBearing = state.bearing;
const double startPitch = state.pitch;
state.panning = unwrappedLatLng != startLatLng;
- state.scaling = scale != startScale;
+ state.scaling = zoom != startZoom;
state.rotating = bearing != startBearing;
const EdgeInsets startEdgeInsets = state.edgeInsets;
startTransition(camera, animation, [=](double t) {
Point<double> framePoint = util::interpolate(startPoint, endPoint, t);
- LatLng frameLatLng = Projection::unproject(framePoint, startScale);
- double frameScale = util::interpolate(startScale, scale, t);
- state.setLatLngZoom(frameLatLng, state.scaleZoom(frameScale));
+ LatLng frameLatLng = Projection::unproject(framePoint, state.zoomScale(startZoom));
+ double frameZoom = util::interpolate(startZoom, zoom, t);
+ state.setLatLngZoom(frameLatLng, frameZoom);
if (bearing != startBearing) {
state.bearing = util::wrap(util::interpolate(startBearing, bearing, t), -M_PI, M_PI);