summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMinh Nguyễn <mxn@1ec5.org>2015-05-06 16:38:59 -0700
committerMinh Nguyễn <mxn@1ec5.org>2015-05-06 16:38:59 -0700
commitd876274ad19866c8395c97ef4fd1f31eddf3b23c (patch)
treeff7dff85e2f82ec330b113a36ec2cc941470a430
parent6c31d928e1c32ceaee07384e47c644f3643be447 (diff)
downloadqtlocation-mapboxgl-d876274ad19866c8395c97ef4fd1f31eddf3b23c.tar.gz
Prevent full-circle spin during animated rotation
#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
-rw-r--r--src/mbgl/map/transform.cpp1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/mbgl/map/transform.cpp b/src/mbgl/map/transform.cpp
index ffe7422962..1239f96f5e 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;