diff options
author | Mikhail Pozdnyakov <mikhail.pozdnyakov@mapbox.com> | 2020-03-10 12:12:33 +0200 |
---|---|---|
committer | Mikhail Pozdnyakov <mikhail.pozdnyakov@mapbox.com> | 2020-03-10 20:32:34 +0200 |
commit | cc5e86b1866163de04e10bae7ecaf62a92d1aae5 (patch) | |
tree | 7be619963bd8323923529049e80b9d92c04744ca | |
parent | deb1161366f5ba5f18b574fc3ef664590bb36e94 (diff) | |
download | qtlocation-mapboxgl-cc5e86b1866163de04e10bae7ecaf62a92d1aae5.tar.gz |
[core][tile mode] Fix assertion at `line-center` placement handling
The `symbolIntersectsTileEdges` algorithm should not be applied to the symbols with `line-center` placement
-rw-r--r-- | src/mbgl/text/placement.cpp | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/src/mbgl/text/placement.cpp b/src/mbgl/text/placement.cpp index 73a6d9d228..d6d6e269bc 100644 --- a/src/mbgl/text/placement.cpp +++ b/src/mbgl/text/placement.cpp @@ -174,11 +174,12 @@ void Placement::placeSymbolBucket(const BucketPlacementData& params, std::set<ui optional<CollisionBoundaries> tileBorders; optional<CollisionBoundaries> avoidEdges; - if (mapMode == MapMode::Tile) tileBorders = collisionIndex.projectTileBoundaries(posMatrix); - - if (tileBorders && (layout.get<style::SymbolAvoidEdges>() || - layout.get<style::SymbolPlacement>() == style::SymbolPlacementType::Line)) { - avoidEdges = tileBorders; + if (mapMode == MapMode::Tile) { + tileBorders = collisionIndex.projectTileBoundaries(posMatrix); + if (layout.get<style::SymbolAvoidEdges>() || + layout.get<style::SymbolPlacement>() == style::SymbolPlacementType::Line) { + avoidEdges = tileBorders; + } } const bool textAllowOverlap = layout.get<style::TextAllowOverlap>(); @@ -559,7 +560,8 @@ void Placement::placeSymbolBucket(const BucketPlacementData& params, std::set<ui for (auto it = sortedSymbols.rbegin(); it != sortedSymbols.rend(); ++it) { placeSymbol(*it); } - } else if (mapMode == MapMode::Tile && !avoidEdges) { + } else if (mapMode == MapMode::Tile && !avoidEdges && + layout.get<style::SymbolPlacement>() == style::SymbolPlacementType::Point) { // In this case we first try to place symbols, which intersects the tile borders, so that // those symbols will remain even if each tile is handled independently. SymbolInstanceReferences symbolInstances = bucket.getSymbols(params.sortKeyRange); |