diff options
author | Chris Loer <chris.loer@gmail.com> | 2017-11-13 11:12:03 -0800 |
---|---|---|
committer | Chris Loer <chris.loer@mapbox.com> | 2017-11-17 10:05:15 -0800 |
commit | c39232a89f1feb18454d88f2908f5cbef306b065 (patch) | |
tree | 07589ccc9f4d694688d46367b8c6338660fbf687 /src/mbgl/text/collision_feature.hpp | |
parent | 8cfeae9e458aa156e190617f378a4456c7047129 (diff) | |
download | qtlocation-mapboxgl-c39232a89f1feb18454d88f2908f5cbef306b065.tar.gz |
[core] Cleanup in response to review comments.
Diffstat (limited to 'src/mbgl/text/collision_feature.hpp')
-rw-r--r-- | src/mbgl/text/collision_feature.hpp | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/src/mbgl/text/collision_feature.hpp b/src/mbgl/text/collision_feature.hpp index 4ecd25c717..df1b12819c 100644 --- a/src/mbgl/text/collision_feature.hpp +++ b/src/mbgl/text/collision_feature.hpp @@ -56,19 +56,26 @@ public: : CollisionFeature(line, anchor, shapedText.top, shapedText.bottom, shapedText.left, shapedText.right, boxScale, padding, placement, indexedFeature_, overscaling) {} // for icons + // Icons collision features are always SymbolPlacementType::Point, which means the collision feature + // will be viewport-rotation-aligned even if the icon is map-rotation-aligned (e.g. `icon-rotation-alignment: map` + // _or_ `symbol-placement: line`). We're relying on most icons being "close enough" to square that having + // incorrect rotation alignment doesn't throw off collision detection too much. + // See: https://github.com/mapbox/mapbox-gl-js/issues/4861 CollisionFeature(const GeometryCoordinates& line, const Anchor& anchor, optional<PositionedIcon> shapedIcon, const float boxScale, const float padding, - const style::SymbolPlacementType placement, const IndexedSubfeature& indexedFeature_) : CollisionFeature(line, anchor, (shapedIcon ? shapedIcon->top() : 0), (shapedIcon ? shapedIcon->bottom() : 0), (shapedIcon ? shapedIcon->left() : 0), (shapedIcon ? shapedIcon->right() : 0), - boxScale, padding, placement, indexedFeature_, 1) {} + boxScale, + padding, + style::SymbolPlacementType::Point, + indexedFeature_, 1) {} CollisionFeature(const GeometryCoordinates& line, const Anchor&, |