summaryrefslogtreecommitdiff
path: root/test/util
diff options
context:
space:
mode:
authorAleksandar Stojiljkovic <aleksandar.stojiljkovic@mapbox.com>2019-08-23 12:04:32 +0300
committerAleksandar Stojiljkovic <aleksandar.stojiljkovic@mapbox.com>2019-08-23 16:43:05 +0300
commit9eff849c743c6e861404a2c39afa53c4eecdca3d (patch)
tree6c6eaaaf5f29b1570e3fc00aa5fb9ab16bedb7da /test/util
parent13d2667035f8e5d8319556a275bb60093e24130d (diff)
downloadqtlocation-mapboxgl-9eff849c743c6e861404a2c39afa53c4eecdca3d.tar.gz
[core] Fix tileCover / TileCoordinate fromScreenCoordinate(#15442)
Remove unecessary tile coordinate unproject -> project step. Unproject+project isn't always a noop and this was the issue leading to wrong cover calculation in high pitch values. Fixes: https://github.com/mapbox/mapbox-gl-native/issues/15442
Diffstat (limited to 'test/util')
-rw-r--r--test/util/tile_cover.test.cpp14
1 files changed, 14 insertions, 0 deletions
diff --git a/test/util/tile_cover.test.cpp b/test/util/tile_cover.test.cpp
index e35e6e2e99..af9f0c4884 100644
--- a/test/util/tile_cover.test.cpp
+++ b/test/util/tile_cover.test.cpp
@@ -43,6 +43,20 @@ TEST(TileCover, Pitch) {
util::tileCover(transform.getState(), 2));
}
+TEST(TileCover, PitchIssue15442) {
+ Transform transform;
+ transform.resize({ 412, 691 });
+
+ transform.jumpTo(CameraOptions().withCenter(LatLng { 59.116898740996106, 91.565660781803615, })
+ .withZoom(2.0551126748417214).withBearing(0.74963938256567264 * util::RAD2DEG)
+ .withPitch(1.0471975511965976 * util::RAD2DEG));
+
+ EXPECT_EQ((std::vector<UnwrappedTileID>{
+ { 2, 3, 1 }, { 2, 2, 1 }, { 2, 3, 0 }, { 2, 2, 0 }, { 1, { 2, 0, 0 } }, { 1, { 2, 1, 0 } }
+ }),
+ util::tileCover(transform.getState(), 2));
+}
+
TEST(TileCover, PitchOverAllowedByContentInsets) {
Transform transform;
transform.resize({ 512, 512 });