diff options
author | Ansis Brammanis <brammanis@gmail.com> | 2017-06-30 15:38:43 -0400 |
---|---|---|
committer | Ansis Brammanis <brammanis@gmail.com> | 2017-07-11 09:10:25 -0700 |
commit | d661b4ba61a7bd7770c96464c190bfadf9a42414 (patch) | |
tree | bdec86a0a786028b44c64b308e875fc3fea9e218 /src/mbgl/text/collision_feature.hpp | |
parent | e514138b691615be24f484986c40f486223df82a (diff) | |
download | qtlocation-mapboxgl-d661b4ba61a7bd7770c96464c190bfadf9a42414.tar.gz |
[core] port pitch-label collision hack
https://github.com/mapbox/mapbox-gl-js/pull/4781/commits/81363951ed56c54f331ffc8d88e4e5079226a224
Diffstat (limited to 'src/mbgl/text/collision_feature.hpp')
-rw-r--r-- | src/mbgl/text/collision_feature.hpp | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/src/mbgl/text/collision_feature.hpp b/src/mbgl/text/collision_feature.hpp index c94ec23513..3b6e461a26 100644 --- a/src/mbgl/text/collision_feature.hpp +++ b/src/mbgl/text/collision_feature.hpp @@ -11,11 +11,16 @@ namespace mbgl { class CollisionBox { public: - CollisionBox(Point<float> _anchor, float _x1, float _y1, float _x2, float _y2, float _maxScale) : - anchor(std::move(_anchor)), x1(_x1), y1(_y1), x2(_x2), y2(_y2), maxScale(_maxScale) {} + CollisionBox(Point<float> _anchor, Point<float> _offset, float _x1, float _y1, float _x2, float _y2, float _maxScale) : + anchor(std::move(_anchor)), offset(_offset), x1(_x1), y1(_y1), x2(_x2), y2(_y2), maxScale(_maxScale) {} + + float adjustedMaxScale(const std::array<float, 4>& rotationMatrix, const float yStretch) const; // the box is centered around the anchor point Point<float> anchor; + + // the offset of the box from the label's anchor point + Point<float> offset; // distances to the edges from the anchor float x1; |