From ea6b2061b5602a266a2a66e3058e0cd671eb69d4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Paczos?= Date: Mon, 8 Jul 2019 16:26:33 +0200 Subject: [core] decrease the minimum pixel distance required to interpolate during camera animation The changes introduced in #9199 changed the minimum required pixel distance between start and end points to >= 1px in order to interpolate, which in scenarios of big zoom changes and low pixel density can result in animation to the previous position and then a jump to the target. --- src/mbgl/map/transform.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/mbgl/map/transform.cpp b/src/mbgl/map/transform.cpp index 88b559592e..a51d4dd4ff 100644 --- a/src/mbgl/map/transform.cpp +++ b/src/mbgl/map/transform.cpp @@ -236,7 +236,7 @@ void Transform::flyTo(const CameraOptions &camera, const AnimationOptions &anima double r1 = r(1); // When u₀ = u₁, the optimal path doesn’t require both ascent and descent. - bool isClose = std::abs(u1) < 1.0 || !std::isfinite(r0) || !std::isfinite(r1); + bool isClose = std::abs(u1) < 0.000001 || !std::isfinite(r0) || !std::isfinite(r1); /** w(s): Returns the visible span on the ground, measured in pixels with respect to the initial scale. -- cgit v1.2.1