diff options
author | Lauren Budorick <lauren@mapbox.com> | 2017-12-20 15:17:11 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-12-20 15:17:11 -0500 |
commit | 920057c9d6285fc30f4155a505e2bf15143e3842 (patch) | |
tree | 37c9e1c357f818799be29d56f3c5cdafa8a58797 /src/mbgl/renderer/buckets | |
parent | d744b5033b994e2301621f68565cef622e3ba40f (diff) | |
download | qtlocation-mapboxgl-920057c9d6285fc30f4155a505e2bf15143e3842.tar.gz |
[core] Better align fill-extrusion vertex layout
Diffstat (limited to 'src/mbgl/renderer/buckets')
-rw-r--r-- | src/mbgl/renderer/buckets/fill_extrusion_bucket.cpp | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/mbgl/renderer/buckets/fill_extrusion_bucket.cpp b/src/mbgl/renderer/buckets/fill_extrusion_bucket.cpp index 7f53326fe1..5e2c937091 100644 --- a/src/mbgl/renderer/buckets/fill_extrusion_bucket.cpp +++ b/src/mbgl/renderer/buckets/fill_extrusion_bucket.cpp @@ -101,13 +101,17 @@ void FillExtrusionBucket::addFeature(const GeometryTileFeature& feature, const auto d2 = convertPoint<double>(p2); 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()) { + edgeDistance = 0; + } vertices.emplace_back( FillExtrusionProgram::layoutVertex(p1, perp.x, perp.y, 0, 0, edgeDistance)); vertices.emplace_back( FillExtrusionProgram::layoutVertex(p1, perp.x, perp.y, 0, 1, edgeDistance)); - edgeDistance += util::dist<int16_t>(d1, d2); + edgeDistance += dist; vertices.emplace_back( FillExtrusionProgram::layoutVertex(p2, perp.x, perp.y, 0, 0, edgeDistance)); |