From d876274ad19866c8395c97ef4fd1f31eddf3b23c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Minh=20Nguy=E1=BB=85n?= Date: Wed, 6 May 2015 16:38:59 -0700 Subject: [PATCH] Prevent full-circle spin during animated rotation MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit #1295 made #1199 a lot less common, but it was still possible for the map to do a full 180° when drift-rotating past due-south. With this change, the map is atomically rotated to a bearing in the same cycle as the final bearing. /cc @friedbunny --- src/mbgl/map/transform.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/mbgl/map/transform.cpp b/src/mbgl/map/transform.cpp index ffe742296..1239f96f5 100644 --- a/src/mbgl/map/transform.cpp +++ b/src/mbgl/map/transform.cpp @@ -348,6 +348,7 @@ void Transform::_setAngle(double new_angle, const Duration duration) { MapChangeRegionWillChange); final.angle = _normalizeAngle(new_angle, current.angle); + current.angle = _normalizeAngle(current.angle, final.angle); if (duration == Duration::zero()) { current.angle = final.angle;