diff options
author | Chris Loer <chris.loer@gmail.com> | 2017-11-10 16:02:11 -0800 |
---|---|---|
committer | Chris Loer <chris.loer@mapbox.com> | 2017-11-13 10:19:20 -0800 |
commit | bcc72aea469d1968619bc45456198dc30e5a8471 (patch) | |
tree | 0e05d51ac06cc571be679bee88cdf768b12e49a8 /src/mbgl/text/collision_index.hpp | |
parent | f8baef3158a0d1bd567a0dfcdec304f21ed178fe (diff) | |
download | qtlocation-mapboxgl-bcc72aea469d1968619bc45456198dc30e5a8471.tar.gz |
Skip fade animation for placed symbols that are currently offscreen.
Don't mark items that are outside the collision grid range as placed.
Requires new ignore because GL JS issue #5654 allows insertion of symbols outside the CollisionIndex range, and those symbols can cascade in to affect items within the viewport.
Diffstat (limited to 'src/mbgl/text/collision_index.hpp')
-rw-r--r-- | src/mbgl/text/collision_index.hpp | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/src/mbgl/text/collision_index.hpp b/src/mbgl/text/collision_index.hpp index 6f78d8aeda..8653c1d76c 100644 --- a/src/mbgl/text/collision_index.hpp +++ b/src/mbgl/text/collision_index.hpp @@ -17,7 +17,7 @@ public: explicit CollisionIndex(const TransformState&); - bool placeFeature(CollisionFeature& feature, + std::pair<bool,bool> placeFeature(CollisionFeature& feature, const mat4& posMatrix, const mat4& labelPlaneMatrix, const float textPixelRatio, @@ -34,7 +34,10 @@ public: private: - bool placeLineFeature(CollisionFeature& feature, + bool isOffscreen(const CollisionBox&) const; + bool isInsideGrid(const CollisionBox&) const; + + std::pair<bool,bool> placeLineFeature(CollisionFeature& feature, const mat4& posMatrix, const mat4& labelPlaneMatrix, const float textPixelRatio, @@ -51,11 +54,17 @@ private: std::pair<Point<float>,float> projectAndGetPerspectiveRatio(const mat4& posMatrix, const Point<float>& point) const; Point<float> projectPoint(const mat4& posMatrix, const Point<float>& point) const; - TransformState transformState; - float pitchFactor; + const TransformState transformState; CollisionGrid collisionGrid; CollisionGrid ignoredGrid; + + const float screenRightBoundary; + const float screenBottomBoundary; + const float gridRightBoundary; + const float gridBottomBoundary; + + const float pitchFactor; }; } // namespace mbgl |