summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorMinh Nguyễn <mxn@1ec5.org>2016-07-16 14:19:14 -0700
committerMinh Nguyễn <mxn@1ec5.org>2016-07-18 15:21:35 -0700
commit8179f2f6b2c185c16745c6a3faf4d4bd9683ef16 (patch)
treee88ec0d143bd6bc6e65ddb9641e95ac2592ac0b4 /test
parentede1e713d8b66be713d96141653b83078443cbea (diff)
downloadqtlocation-mapboxgl-8179f2f6b2c185c16745c6a3faf4d4bd9683ef16.tar.gz
[core] Restored shape annotation z-order
Shapes are once again always added to the top z-index. Fixes #5691. Cherry-picked from 74fe96d2617f870206ff358d7dfcafccf4e109bc.
Diffstat (limited to 'test')
-rw-r--r--test/api/annotations.cpp15
-rw-r--r--test/fixtures/annotations/overlapping_fill_annotation/expected.pngbin0 -> 1538 bytes
2 files changed, 15 insertions, 0 deletions
diff --git a/test/api/annotations.cpp b/test/api/annotations.cpp
index 60d7db6baa..552a386f96 100644
--- a/test/api/annotations.cpp
+++ b/test/api/annotations.cpp
@@ -68,6 +68,21 @@ TEST(Annotations, FillAnnotation) {
test.checkRendering("fill_annotation");
}
+TEST(Annotations, OverlappingFillAnnotation) {
+ AnnotationTest test;
+
+ Polygon<double> polygon = {{ {{ { 0, 0 }, { 0, 45 }, { 45, 45 }, { 45, 0 } }} }};
+ FillAnnotation underlaidAnnotation { polygon };
+ underlaidAnnotation.color = { { 0, 255, 0, 1 } };
+ FillAnnotation overlaidAnnotation { polygon };
+ overlaidAnnotation.color = { { 255, 0, 0, 1 } };
+
+ test.map.setStyleJSON(util::read_file("test/fixtures/api/empty.json"));
+ test.map.addAnnotation(underlaidAnnotation);
+ test.map.addAnnotation(overlaidAnnotation);
+ test.checkRendering("overlapping_fill_annotation");
+}
+
TEST(Annotations, StyleSourcedShapeAnnotation) {
AnnotationTest test;
diff --git a/test/fixtures/annotations/overlapping_fill_annotation/expected.png b/test/fixtures/annotations/overlapping_fill_annotation/expected.png
new file mode 100644
index 0000000000..09f48081a8
--- /dev/null
+++ b/test/fixtures/annotations/overlapping_fill_annotation/expected.png
Binary files differ