diff options
author | Chris Loer <chris.loer@gmail.com> | 2018-06-26 15:05:37 -0700 |
---|---|---|
committer | Chris Loer <chris.loer@mapbox.com> | 2018-07-03 15:28:00 -0700 |
commit | d734f670e8127c7600beb6dad7b7f08b1401e7c0 (patch) | |
tree | 0f37564d1c5034639bfdfb259e3f9c3a1f51be52 /src/mbgl/layout/symbol_layout.cpp | |
parent | cfd436c287f4209d0d994042452ccbb552a6bd28 (diff) | |
download | qtlocation-mapboxgl-d734f670e8127c7600beb6dad7b7f08b1401e7c0.tar.gz |
[core] Fix sort order for queryRenderedFeatures when features are filtered.
Fixes issue #12104.
Diffstat (limited to 'src/mbgl/layout/symbol_layout.cpp')
-rw-r--r-- | src/mbgl/layout/symbol_layout.cpp | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/src/mbgl/layout/symbol_layout.cpp b/src/mbgl/layout/symbol_layout.cpp index 4249ffc24e..e71cfb93b0 100644 --- a/src/mbgl/layout/symbol_layout.cpp +++ b/src/mbgl/layout/symbol_layout.cpp @@ -260,7 +260,7 @@ void SymbolLayout::prepare(const GlyphMap& glyphMap, const GlyphPositions& glyph compareText.clear(); } -void SymbolLayout::addFeature(const std::size_t index, +void SymbolLayout::addFeature(const std::size_t layoutFeatureIndex, const SymbolFeature& feature, const std::pair<Shaping, Shaping>& shapedTextOrientations, optional<PositionedIcon> shapedIcon, @@ -317,10 +317,9 @@ void SymbolLayout::addFeature(const std::size_t index, if (mode == MapMode::Tile || withinPlus0) { symbolInstances.emplace_back(anchor, line, shapedTextOrientations, shapedIcon, layout.evaluate(zoom, feature), layoutTextSize, - symbolInstances.size(), textBoxScale, textPadding, textPlacement, textOffset, iconBoxScale, iconPadding, iconOffset, - glyphPositionMap, indexedFeature, index, feature.text.value_or(std::u16string()), overscaling); + glyphPositionMap, indexedFeature, layoutFeatureIndex, feature.index, feature.text.value_or(std::u16string()), overscaling); } }; @@ -426,7 +425,7 @@ std::unique_ptr<SymbolBucket> SymbolLayout::place(const bool showCollisionBoxes) const bool hasText = symbolInstance.hasText; const bool hasIcon = symbolInstance.hasIcon; - const auto& feature = features.at(symbolInstance.featureIndex); + const auto& feature = features.at(symbolInstance.layoutFeatureIndex); // Insert final placement into collision tree and add glyphs/icons to buffers |