summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorBruno de Oliveira Abinader <bruno@mapbox.com>2018-11-23 22:47:40 +0200
committerBruno de Oliveira Abinader <bruno@mapbox.com>2018-11-26 17:15:51 +0200
commit52cce7925d32181a20a79978479c5552fa6ae810 (patch)
tree4b932205bcc6eab2b61cdec72068a2871d3dd132 /test
parent82be3104cd40372e6f99284ff0fccd1e3879fd1d (diff)
downloadqtlocation-mapboxgl-52cce7925d32181a20a79978479c5552fa6ae810.tar.gz
[core] Camera center and anchor points are mutually exclusive
Diffstat (limited to 'test')
-rw-r--r--test/map/transform.test.cpp13
1 files changed, 13 insertions, 0 deletions
diff --git a/test/map/transform.test.cpp b/test/map/transform.test.cpp
index 44b5f49366..06df34c4c4 100644
--- a/test/map/transform.test.cpp
+++ b/test/map/transform.test.cpp
@@ -476,6 +476,19 @@ TEST(Transform, Camera) {
transform.updateTransitions(transform.getTransitionStart() + Milliseconds(750));
transform.updateTransitions(transform.getTransitionStart() + transform.getTransitionDuration());
ASSERT_FALSE(transform.inTransition());
+
+ // Anchor and center points are mutually exclusive.
+ CameraOptions camera;
+ camera.center = LatLng { 0, 0 };
+ camera.anchor = ScreenCoordinate { 0, 0 }; // top-left
+ camera.zoom = transform.getState().getMaxZoom();
+ transform.easeTo(camera, AnimationOptions(Seconds(1)));
+ transform.updateTransitions(transform.getTransitionStart() + Milliseconds(250));
+ transform.updateTransitions(transform.getTransitionStart() + Milliseconds(500));
+ transform.updateTransitions(transform.getTransitionStart() + Milliseconds(750));
+ transform.updateTransitions(transform.getTransitionStart() + transform.getTransitionDuration());
+ ASSERT_DOUBLE_EQ(transform.getLatLng().latitude(), 0);
+ ASSERT_DOUBLE_EQ(transform.getLatLng().longitude(), 0);
}
TEST(Transform, DefaultTransform) {