diff options
author | Karim Naaji <karim.naaji@mapbox.com> | 2020-02-11 17:04:02 -0500 |
---|---|---|
committer | Alexander Shalamov <alexander.shalamov@mapbox.com> | 2020-02-14 12:56:54 +0200 |
commit | 21107e0c1add92fea4ba614dfed968c1c42f41c0 (patch) | |
tree | 2563a7dea3a0d4ded85b2c819b48635896f28e30 /src/mbgl/geometry/line_atlas.hpp | |
parent | bf8bde5029bf2cd54a85af5315ad26636109b9a1 (diff) | |
download | qtlocation-mapboxgl-21107e0c1add92fea4ba614dfed968c1c42f41c0.tar.gz |
Port line-dasharray fix from gl-js
* Fix artifact for zero-lenghted dash array
Fixes issue https://github.com/mapbox/mapbox-gl-js/issues/9213 and add
render test for coverage around 0-length dash arrays
Update distance field generation for regular dashes as follows:
1. Compute the dash array ranges and stretch location along the distance field
2. Collapse any 0-length distance field range
3. Collapse neighbouring same-type parts into single part
* combine consecutive dashes and parts
https://github.com/mapbox/mapbox-gl-js/pull/9246
https://github.com/mapbox/mapbox-gl-native/issues/16181
Diffstat (limited to 'src/mbgl/geometry/line_atlas.hpp')
-rw-r--r-- | src/mbgl/geometry/line_atlas.hpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/mbgl/geometry/line_atlas.hpp b/src/mbgl/geometry/line_atlas.hpp index 853305d138..1be7cbf073 100644 --- a/src/mbgl/geometry/line_atlas.hpp +++ b/src/mbgl/geometry/line_atlas.hpp @@ -27,6 +27,13 @@ enum class LinePatternCap : bool { Round = true, }; +struct DashRange { + float left; + float right; + bool isDash; + bool isZeroLength; +}; + class DashPatternTexture { public: DashPatternTexture(const std::vector<float>& from, const std::vector<float>& to, LinePatternCap); |