summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLauren Budorick <lauren@mapbox.com>2018-05-15 17:40:28 -0700
committerLauren Budorick <lauren@mapbox.com>2018-05-15 17:40:28 -0700
commit35c11078d00057090ba8be5778a1ebd92d97a70a (patch)
tree4c3bae81d89ed4b9a4bbd5368bd88552181c0ad2
parent62c875e01b07197024e3806e8b2882160ce1195c (diff)
downloadqtlocation-mapboxgl-upstream/lbud-extrusion-edgedist-check.tar.gz
Fix bug (always true + incorrect calculation) in fill_extrusion_bucket edgedistance checkupstream/lbud-extrusion-edgedist-check
-rw-r--r--src/mbgl/renderer/buckets/fill_extrusion_bucket.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/mbgl/renderer/buckets/fill_extrusion_bucket.cpp b/src/mbgl/renderer/buckets/fill_extrusion_bucket.cpp
index 5e2c937091..4fcc761280 100644
--- a/src/mbgl/renderer/buckets/fill_extrusion_bucket.cpp
+++ b/src/mbgl/renderer/buckets/fill_extrusion_bucket.cpp
@@ -84,7 +84,7 @@ void FillExtrusionBucket::addFeature(const GeometryTileFeature& feature,
if (nVertices == 0)
continue;
- auto edgeDistance = 0;
+ std::size_t edgeDistance = 0;
for (uint32_t i = 0; i < nVertices; i++) {
const auto& p1 = ring[i];
@@ -102,7 +102,7 @@ void FillExtrusionBucket::addFeature(const GeometryTileFeature& feature,
const Point<double> perp = util::unit(util::perp(d1 - d2));
const auto dist = util::dist<int16_t>(d1, d2);
- if (dist > std::numeric_limits<int16_t>::max()) {
+ if (edgeDistance + dist > std::numeric_limits<int16_t>::max()) {
edgeDistance = 0;
}