summaryrefslogtreecommitdiff
path: root/src/mbgl
diff options
context:
space:
mode:
authorAnsis Brammanis <ansis@mapbox.com>2019-12-06 12:22:12 -0500
committertobrun <tobrun.van.nuland@gmail.com>2019-12-18 10:47:14 +0100
commit5a9b92caf59c955e66a7c15282e7be0acf0be04e (patch)
tree198ffa7c02d731319348ac726b4ee36fff8ceb42 /src/mbgl
parent58e1c9b3997b7daa7bf01e6e2bbc6cec645f3b49 (diff)
downloadqtlocation-mapboxgl-5a9b92caf59c955e66a7c15282e7be0acf0be04e.tar.gz
[core] Fix really overscaled lines #16018upstream/tvn-cp-release-tequila
Diffstat (limited to 'src/mbgl')
-rw-r--r--src/mbgl/renderer/buckets/line_bucket.cpp13
1 files changed, 7 insertions, 6 deletions
diff --git a/src/mbgl/renderer/buckets/line_bucket.cpp b/src/mbgl/renderer/buckets/line_bucket.cpp
index e756722854..e272593e48 100644
--- a/src/mbgl/renderer/buckets/line_bucket.cpp
+++ b/src/mbgl/renderer/buckets/line_bucket.cpp
@@ -129,18 +129,19 @@ void LineBucket::addGeometry(const GeometryCoordinates& coordinates, const Geome
total_length += util::dist<double>(coordinates[i], coordinates[i + 1]);
}
- lineDistances = Distances{*numericValue<double>(clip_start_it->second),
- *numericValue<double>(clip_end_it->second),
- total_length};
+ lineDistances = Distances{
+ *numericValue<double>(clip_start_it->second), *numericValue<double>(clip_end_it->second), total_length};
}
const LineJoinType joinType = layout.evaluate<LineJoin>(zoom, feature);
const float miterLimit = joinType == LineJoinType::Bevel ? 1.05f : float(layout.get<LineMiterLimit>());
- const double sharpCornerOffset = overscaling == 0 ?
- SHARP_CORNER_OFFSET * (float(util::EXTENT) / util::tileSize) :
- SHARP_CORNER_OFFSET * (float(util::EXTENT) / (util::tileSize * overscaling));
+ const double sharpCornerOffset =
+ overscaling == 0
+ ? SHARP_CORNER_OFFSET * (float(util::EXTENT) / util::tileSize)
+ : (overscaling <= 16.0 ? SHARP_CORNER_OFFSET * (float(util::EXTENT) / (util::tileSize * overscaling))
+ : 0.0f);
const GeometryCoordinate firstCoordinate = coordinates[first];
const LineCapType beginCap = layout.get<LineCap>();