summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorBruno de Oliveira Abinader <bruno@mapbox.com>2016-10-20 19:11:34 +0300
committerBruno de Oliveira Abinader <bruno@mapbox.com>2016-10-25 08:12:31 +0300
commit8743f1134528d5e8e7b0b2af582e11ff5ee3088f (patch)
tree52cbddae73d5a58fe8b93deb8443dba53b28b4ec /src
parented1ceecc0994da19b520b89d4d355528a71be717 (diff)
downloadqtlocation-mapboxgl-8743f1134528d5e8e7b0b2af582e11ff5ee3088f.tar.gz
[core] Cleanup function signatures in CollisionTile
- Prefer pass-by-value for primitive types. - Use floating point precision for yStretch to match receiving type.
Diffstat (limited to 'src')
-rw-r--r--src/mbgl/text/collision_tile.cpp8
-rw-r--r--src/mbgl/text/collision_tile.hpp6
2 files changed, 7 insertions, 7 deletions
diff --git a/src/mbgl/text/collision_tile.cpp b/src/mbgl/text/collision_tile.cpp
index d6fc1a6ada..3681581455 100644
--- a/src/mbgl/text/collision_tile.cpp
+++ b/src/mbgl/text/collision_tile.cpp
@@ -36,7 +36,7 @@ CollisionTile::CollisionTile(PlacementConfig config_) : config(std::move(config_
// The amount the map is squished depends on the y position.
// Sort of account for this by making all boxes a bit bigger.
- yStretch = std::pow(_yStretch, 1.3);
+ yStretch = std::pow(_yStretch, 1.3f);
}
@@ -80,7 +80,7 @@ float CollisionTile::findPlacementScale(float minPlacementScale, const Point<flo
return minPlacementScale;
}
-float CollisionTile::placeFeature(const CollisionFeature& feature, const bool allowOverlap, const bool avoidEdges) {
+float CollisionTile::placeFeature(const CollisionFeature& feature, bool allowOverlap, bool avoidEdges) {
float minPlacementScale = minScale;
@@ -124,7 +124,7 @@ float CollisionTile::placeFeature(const CollisionFeature& feature, const bool al
return minPlacementScale;
}
-void CollisionTile::insertFeature(CollisionFeature& feature, const float minPlacementScale, const bool ignorePlacement) {
+void CollisionTile::insertFeature(CollisionFeature& feature, float minPlacementScale, bool ignorePlacement) {
for (auto& box : feature.boxes) {
box.placementScale = minPlacementScale;
}
@@ -156,7 +156,7 @@ Box CollisionTile::getTreeBox(const Point<float>& anchor, const CollisionBox& bo
};
}
-std::vector<IndexedSubfeature> CollisionTile::queryRenderedSymbols(const GeometryCoordinates& queryGeometry, const float scale) {
+std::vector<IndexedSubfeature> CollisionTile::queryRenderedSymbols(const GeometryCoordinates& queryGeometry, float scale) {
std::vector<IndexedSubfeature> result;
if (queryGeometry.empty()) return result;
diff --git a/src/mbgl/text/collision_tile.hpp b/src/mbgl/text/collision_tile.hpp
index dbc23b2a79..49b97cb8cb 100644
--- a/src/mbgl/text/collision_tile.hpp
+++ b/src/mbgl/text/collision_tile.hpp
@@ -39,10 +39,10 @@ class CollisionTile {
public:
explicit CollisionTile(PlacementConfig);
- float placeFeature(const CollisionFeature&, const bool allowOverlap, const bool avoidEdges);
- void insertFeature(CollisionFeature&, const float minPlacementScale, const bool ignorePlacement);
+ float placeFeature(const CollisionFeature&, bool allowOverlap, bool avoidEdges);
+ void insertFeature(CollisionFeature&, float minPlacementScale, bool ignorePlacement);
- std::vector<IndexedSubfeature> queryRenderedSymbols(const GeometryCoordinates&, const float scale);
+ std::vector<IndexedSubfeature> queryRenderedSymbols(const GeometryCoordinates&, float scale);
const PlacementConfig config;