diff options
author | Ansis Brammanis <ansis@mapbox.com> | 2017-11-07 16:10:58 -0500 |
---|---|---|
committer | Ansis Brammanis <ansis@mapbox.com> | 2017-11-09 13:11:31 -0500 |
commit | cd10190515693dae6cca7ad9087046a8dd2350a6 (patch) | |
tree | 4adc154d0a880486f0abc45c83755ca525375979 /src/mbgl/layout/symbol_projection.cpp | |
parent | 0f4eed2959f7741ccf73dd79297b5fe17ff23829 (diff) | |
download | qtlocation-mapboxgl-upstream/start-collision-async.tar.gz |
partially do Placement asyncupstream/start-collision-async
Diffstat (limited to 'src/mbgl/layout/symbol_projection.cpp')
-rw-r--r-- | src/mbgl/layout/symbol_projection.cpp | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/src/mbgl/layout/symbol_projection.cpp b/src/mbgl/layout/symbol_projection.cpp index fa88ffdf22..393ae1f808 100644 --- a/src/mbgl/layout/symbol_projection.cpp +++ b/src/mbgl/layout/symbol_projection.cpp @@ -353,7 +353,8 @@ namespace mbgl { } - void reprojectLineLabels(gl::VertexVector<SymbolDynamicLayoutAttributes::Vertex>& dynamicVertexArray, const std::vector<PlacedSymbol>& placedSymbols, + void reprojectLineLabels(gl::VertexVector<SymbolDynamicLayoutAttributes::Vertex>& dynamicVertexArray, + const std::vector<PlacedSymbol>& placedSymbols, const std::vector<bool>& placedSymbolVisibility, const mat4& posMatrix, const style::SymbolPropertyValues& values, const RenderTile& tile, const SymbolSizeBinder& sizeBinder, const TransformState& state) { @@ -374,11 +375,17 @@ namespace mbgl { bool useVertical = false; - for (auto& placedSymbol : placedSymbols) { + assert(placedSymbols.size() == placedSymbolVisibility.size()); + auto visibilityIt = placedSymbolVisibility.begin(); + for (auto it = placedSymbols.begin(); it != placedSymbols.end(); it++, visibilityIt++) { + + const PlacedSymbol& placedSymbol = *it; + const bool hidden = *visibilityIt; + // Don't do calculations for vertical glyphs unless the previous symbol was horizontal // and we determined that vertical glyphs were necessary. // Also don't do calculations for symbols that are collided and fully faded out - if (placedSymbol.hidden || (placedSymbol.writingModes == WritingModeType::Vertical && !useVertical)) { + if (hidden || (placedSymbol.writingModes == WritingModeType::Vertical && !useVertical)) { hideGlyphs(placedSymbol.glyphOffsets.size(), dynamicVertexArray); continue; } |