diff options
author | Ansis Brammanis <brammanis@gmail.com> | 2017-06-16 10:42:33 -0400 |
---|---|---|
committer | Ansis Brammanis <brammanis@gmail.com> | 2017-07-11 09:10:24 -0700 |
commit | e514138b691615be24f484986c40f486223df82a (patch) | |
tree | 4cab221d92f66feefd132818a700c47cc67ef245 /src/mbgl/layout/symbol_instance.hpp | |
parent | 77734cfe1b9e77a0058fa3e0db79e3c20a264165 (diff) | |
download | qtlocation-mapboxgl-e514138b691615be24f484986c40f486223df82a.tar.gz |
[core] improve legibility of labels that follow lines
port https://github.com/mapbox/mapbox-gl-js/pull/4781
This improves legibility of labels that follow lines in pitched views.
The previous approach used the limited information in the shader to
calculate put the glyph in approximatelyright place. The new approach
does this more accurately by doing it on the cpu where we have access to
the entire line geometry.
Diffstat (limited to 'src/mbgl/layout/symbol_instance.hpp')
-rw-r--r-- | src/mbgl/layout/symbol_instance.hpp | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/src/mbgl/layout/symbol_instance.hpp b/src/mbgl/layout/symbol_instance.hpp index f199d929df..f1df416cd1 100644 --- a/src/mbgl/layout/symbol_instance.hpp +++ b/src/mbgl/layout/symbol_instance.hpp @@ -13,7 +13,7 @@ class IndexedSubfeature; class SymbolInstance { public: SymbolInstance(Anchor& anchor, - const GeometryCoordinates& line, + GeometryCoordinates line, const std::pair<Shaping, Shaping>& shapedTextOrientations, optional<PositionedIcon> shapedIcon, const style::SymbolLayoutProperties::Evaluated&, @@ -23,14 +23,17 @@ public: const float textBoxScale, const float textPadding, style::SymbolPlacementType textPlacement, + const std::array<float, 2> textOffset, const float iconBoxScale, const float iconPadding, style::SymbolPlacementType iconPlacement, + const std::array<float, 2> iconOffset, const GlyphPositionMap&, const IndexedSubfeature&, const std::size_t featureIndex); - Point<float> point; + Anchor anchor; + GeometryCoordinates line; uint32_t index; bool hasText; bool hasIcon; @@ -40,6 +43,8 @@ public: CollisionFeature iconCollisionFeature; WritingModeType writingModes; std::size_t featureIndex; + std::array<float, 2> textOffset; + std::array<float, 2> iconOffset; }; } // namespace mbgl |