diff options
author | Ansis Brammanis <brammanis@gmail.com> | 2015-04-01 15:14:49 -0700 |
---|---|---|
committer | Ansis Brammanis <brammanis@gmail.com> | 2015-04-01 16:11:48 -0700 |
commit | e1059e71257aea559776f979f801ba666fc47a44 (patch) | |
tree | 4a4b8b4bd31ddbf8e380aa955207d582588de9b9 /src/mbgl/text/collision_tile.cpp | |
parent | fd526ae68ec193574fb69ca22df59134d3ec13ca (diff) | |
download | qtlocation-mapboxgl-e1059e71257aea559776f979f801ba666fc47a44.tar.gz |
port SymbolBucket::placeFeatures
Diffstat (limited to 'src/mbgl/text/collision_tile.cpp')
-rw-r--r-- | src/mbgl/text/collision_tile.cpp | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/src/mbgl/text/collision_tile.cpp b/src/mbgl/text/collision_tile.cpp index a6ae4682ad..88a3c6bdd1 100644 --- a/src/mbgl/text/collision_tile.cpp +++ b/src/mbgl/text/collision_tile.cpp @@ -3,9 +3,6 @@ namespace mbgl { -const float minScale = 0.5f; -const float maxScale = 2.0f; - void CollisionTile::reset(const float _angle, const float pitch) { tree.clear(); angle = _angle; @@ -23,7 +20,7 @@ void CollisionTile::reset(const float _angle, const float pitch) { yStretch = std::pow(_yStretch, 1.3); } -float CollisionTile::placeFeature(CollisionFeature &feature) { +float CollisionTile::placeFeature(const CollisionFeature &feature) { float minPlacementScale = minScale; @@ -47,7 +44,7 @@ float CollisionTile::placeFeature(CollisionFeature &feature) { if (std::isnan(s1) || std::isnan(s2)) s1 = s2 = 1; if (std::isnan(s3) || std::isnan(s4)) s3 = s4 = 1; - float collisionFreeScale = std::fmin(std::fmax(s1, s3), std::fmax(s3, s4)); + float collisionFreeScale = std::fmin(std::fmax(s1, s2), std::fmax(s3, s4)); if (collisionFreeScale > blocking.maxScale) { // After a box's maxScale the label has shrunk enough that the box is no longer needed to cover it, |