diff options
author | Ansis Brammanis <ansis@mapbox.com> | 2018-05-17 11:30:04 -0400 |
---|---|---|
committer | Ansis Brammanis <ansis.brammanis@gmail.com> | 2018-05-22 14:58:11 -0400 |
commit | 5e36f669acd756d26e2dfa6db1a2a94bd1ceb701 (patch) | |
tree | 553489b2de586e872c9c89d7d4038d5e93f5ce2d /include/mbgl/tile | |
parent | 60505b03174b5ec02ae723beafa7683f6ed54a62 (diff) | |
download | qtlocation-mapboxgl-5e36f669acd756d26e2dfa6db1a2a94bd1ceb701.tar.gz |
[core] avoid symbol flickering when longitude is wrapped
Diffstat (limited to 'include/mbgl/tile')
-rw-r--r-- | include/mbgl/tile/tile_id.hpp | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/include/mbgl/tile/tile_id.hpp b/include/mbgl/tile/tile_id.hpp index 11fb5ce537..3b52596f6c 100644 --- a/include/mbgl/tile/tile_id.hpp +++ b/include/mbgl/tile/tile_id.hpp @@ -58,10 +58,11 @@ public: uint32_t overscaleFactor() const; OverscaledTileID scaledTo(uint8_t z) const; UnwrappedTileID toUnwrapped() const; + OverscaledTileID unwrapTo(int16_t wrap); - const uint8_t overscaledZ; - const int16_t wrap; - const CanonicalTileID canonical; + uint8_t overscaledZ; + int16_t wrap; + CanonicalTileID canonical; }; ::std::ostream& operator<<(::std::ostream& os, const OverscaledTileID& rhs); @@ -191,6 +192,10 @@ inline UnwrappedTileID OverscaledTileID::toUnwrapped() const { return { wrap, canonical }; } +inline OverscaledTileID OverscaledTileID::unwrapTo(int16_t newWrap) { + return { overscaledZ, newWrap, canonical }; +} + inline UnwrappedTileID::UnwrappedTileID(uint8_t z_, int64_t x_, int64_t y_) : wrap((x_ < 0 ? x_ - (1ll << z_) + 1 : x_) / (1ll << z_)), canonical( |