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
This commit is contained in:
Minh Nguyễn
2015-05-06 16:38:59 -07:00
parent 6c31d928e1
commit d876274ad1

View File

@@ -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;