summaryrefslogtreecommitdiff
path: root/include/mbgl
diff options
context:
space:
mode:
authorRyan Hamley <rshamley@gmail.com>2018-10-24 18:38:54 -0700
committerGitHub <noreply@github.com>2018-10-24 18:38:54 -0700
commit3ec0231bb7ed923e82c08ac37950c1fdc366620d (patch)
tree5c8d37d6efaecbe05bc4e53a4570a14fd5f20c33 /include/mbgl
parent7def0888c450359890239a8bf0bcbe46f9d28f4f (diff)
downloadqtlocation-mapboxgl-3ec0231bb7ed923e82c08ac37950c1fdc366620d.tar.gz
[core] Avoid wrapping longitude values of exactly 180 and 360 (#12797) (#13006)
Diffstat (limited to 'include/mbgl')
-rw-r--r--include/mbgl/util/geo.hpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/include/mbgl/util/geo.hpp b/include/mbgl/util/geo.hpp
index dacdb968f3..2df32a7b26 100644
--- a/include/mbgl/util/geo.hpp
+++ b/include/mbgl/util/geo.hpp
@@ -61,7 +61,7 @@ public:
// world, unwrap the start longitude to ensure the shortest path is taken.
void unwrapForShortestPath(const LatLng& end) {
const double delta = std::abs(end.lon - lon);
- if (delta < util::LONGITUDE_MAX || delta > util::DEGREES_MAX) return;
+ if (delta <= util::LONGITUDE_MAX || delta >= util::DEGREES_MAX) return;
if (lon > 0 && end.lon < 0) lon -= util::DEGREES_MAX;
else if (lon < 0 && end.lon > 0) lon += util::DEGREES_MAX;
}