diff options
author | John Firebaugh <john.firebaugh@gmail.com> | 2017-04-04 07:35:26 -0700 |
---|---|---|
committer | John Firebaugh <john.firebaugh@gmail.com> | 2017-04-06 09:22:51 -0700 |
commit | 16a2839e23d42d4640ef028d62dc01322a0d2e5a (patch) | |
tree | b8b8ba6e7c9f2e91cc3ec230bb9420e3827f3c27 /src/mbgl/map/transform.cpp | |
parent | a261f7ff532584b3bbbe4ddef2d0ff96a1ee65a5 (diff) | |
download | qtlocation-mapboxgl-16a2839e23d42d4640ef028d62dc01322a0d2e5a.tar.gz |
[all] Make LatLng coordinates read-only
Diffstat (limited to 'src/mbgl/map/transform.cpp')
-rw-r--r-- | src/mbgl/map/transform.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/mbgl/map/transform.cpp b/src/mbgl/map/transform.cpp index 71d216f1ed..c30b8d9687 100644 --- a/src/mbgl/map/transform.cpp +++ b/src/mbgl/map/transform.cpp @@ -103,7 +103,9 @@ void Transform::easeTo(const CameraOptions& camera, const AnimationOptions& anim // If gesture in progress, we transfer the world rounds from the end // longitude into start, so we can guarantee the "scroll effect" of rounding // the world while assuring the end longitude remains wrapped. - if (isGestureInProgress()) startLatLng.longitude -= unwrappedLatLng.longitude - latLng.longitude; + if (isGestureInProgress()) { + startLatLng = LatLng(startLatLng.latitude(), startLatLng.longitude() - (unwrappedLatLng.longitude() - latLng.longitude())); + } // Find the shortest path otherwise. else startLatLng.unwrapForShortestPath(latLng); |