From 8743f1134528d5e8e7b0b2af582e11ff5ee3088f Mon Sep 17 00:00:00 2001 From: Bruno de Oliveira Abinader Date: Thu, 20 Oct 2016 19:11:34 +0300 Subject: [core] Cleanup function signatures in CollisionTile - Prefer pass-by-value for primitive types. - Use floating point precision for yStretch to match receiving type. --- src/mbgl/text/collision_tile.cpp | 8 ++++---- src/mbgl/text/collision_tile.hpp | 6 +++--- 2 files changed, 7 insertions(+), 7 deletions(-) (limited to 'src') 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& anchor, const CollisionBox& bo }; } -std::vector CollisionTile::queryRenderedSymbols(const GeometryCoordinates& queryGeometry, const float scale) { +std::vector CollisionTile::queryRenderedSymbols(const GeometryCoordinates& queryGeometry, float scale) { std::vector 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 queryRenderedSymbols(const GeometryCoordinates&, const float scale); + std::vector queryRenderedSymbols(const GeometryCoordinates&, float scale); const PlacementConfig config; -- cgit v1.2.1