summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAnsis Brammanis <brammanis@gmail.com>2015-09-03 17:01:46 -0400
committerJohn Firebaugh <john.firebaugh@gmail.com>2015-09-16 12:15:43 -0700
commitf1edf1043bce36d7841ae72233353563a90aed81 (patch)
tree9bc6af3881e4a51a2e071e3aa1f87912b1fa78d2 /src
parent49d855769b0ac710d6e93285e90cb8fb75940f8f (diff)
downloadqtlocation-mapboxgl-f1edf1043bce36d7841ae72233353563a90aed81.tar.gz
fix circle clipping bug
https://github.com/mapbox/mapbox-gl-js/commit/91d2e0ee5cf4ed3811804ef40b1696f93de74410
Diffstat (limited to 'src')
-rw-r--r--src/mbgl/renderer/circle_bucket.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/mbgl/renderer/circle_bucket.cpp b/src/mbgl/renderer/circle_bucket.cpp
index a6a439d862..ae8eeef9dc 100644
--- a/src/mbgl/renderer/circle_bucket.cpp
+++ b/src/mbgl/renderer/circle_bucket.cpp
@@ -35,11 +35,15 @@ bool CircleBucket::hasData() const {
}
void CircleBucket::addGeometry(const GeometryCollection& geometryCollection) {
+ const int extent = 4096;
for (auto& circle : geometryCollection) {
for(auto & geometry : circle) {
auto x = geometry.x;
auto y = geometry.y;
+ // Do not include points that are outside the tile boundaries.
+ if (x < 0 || x >= extent || y < 0 || y >= extent) continue;
+
// this geometry will be of the Point type, and we'll derive
// two triangles from it.
//