summaryrefslogtreecommitdiff
path: root/src/mbgl/text/collision_index.hpp
diff options
context:
space:
mode:
authorMikhail Pozdnyakov <mikhail.pozdnyakov@mapbox.com>2020-01-31 14:42:12 +0200
committerMikhail Pozdnyakov <mikhail.pozdnyakov@mapbox.com>2020-02-03 21:26:35 +0200
commit1f5c6beb64805180a4b4724bc1e5b758b9ae4494 (patch)
tree8e93891a909a5d00d9b1662d5420c20b6b8e2377 /src/mbgl/text/collision_index.hpp
parentb64ed754442b894f3914a4191798fbd2f2bc8cd9 (diff)
downloadqtlocation-mapboxgl-1f5c6beb64805180a4b4724bc1e5b758b9ae4494.tar.gz
[tile mode] Improvements in symbol placement on tile borders
This change fixes the following problems: 1) Before this change, when multiple symbols were grouped close to the tile borders, different tiles could place different symbols, because each tile arbitrary assigned feature ids, and these ids defined the placement order being applied. This caused artifacts at the tile boundaries. With this change, in tile mode the placement order of two symbols crossing a tile border is defined by their anchor `y` values. It means that the symbols are being placed the same order across all the tiles. 2) Before this change, the engine did not place with priority the symbols crossing the borders between two neighboring tiles. Now it does, and it improves a lot symbol placement stability in the tile map mode.
Diffstat (limited to 'src/mbgl/text/collision_index.hpp')
-rw-r--r--src/mbgl/text/collision_index.hpp11
1 files changed, 5 insertions, 6 deletions
diff --git a/src/mbgl/text/collision_index.hpp b/src/mbgl/text/collision_index.hpp
index b9f3e9d88a..2ed3ab81bc 100644
--- a/src/mbgl/text/collision_index.hpp
+++ b/src/mbgl/text/collision_index.hpp
@@ -21,12 +21,11 @@ public:
using CollisionGrid = GridIndex<IndexedSubfeature>;
explicit CollisionIndex(const TransformState&, MapMode);
- bool featureIntersectsTileBorders(const CollisionFeature& feature,
- Point<float> shift,
- const mat4& posMatrix,
- const float textPixelRatio,
- const CollisionBoundaries& tileEdges) const;
-
+ bool intercectsTileEdges(const CollisionBox&,
+ Point<float> shift,
+ const mat4& posMatrix,
+ const float textPixelRatio,
+ const CollisionBoundaries& tileEdges) const;
std::pair<bool, bool> placeFeature(
const CollisionFeature& feature,
Point<float> shift,