diff options
author | Konstantin Käfer <mail@kkaefer.com> | 2018-05-29 14:07:32 +0200 |
---|---|---|
committer | Konstantin Käfer <mail@kkaefer.com> | 2018-06-04 10:43:21 +0200 |
commit | d66251234d7c0feb875b9490ca945ee9d43306c1 (patch) | |
tree | 3c661091edb98ac15a8711e93fde774a5e6e824a /src/mbgl/text | |
parent | d232a7a6f30927cb7e9107c9357bc53e2b1ae0f9 (diff) | |
download | qtlocation-mapboxgl-d66251234d7c0feb875b9490ca945ee9d43306c1.tar.gz |
[core] don't use floating point versions of pow/log
GLIBC 2.27 added new versioned symbols of powf and logf, while the double versions of pow and log remained stable.
Prefer the double version to avoid introducing a dependency on a newer version of GLIBC than strictly necessary.
See https://lists.gnu.org/archive/html/info-gnu/2018-02/msg00000.html
Diffstat (limited to 'src/mbgl/text')
-rw-r--r-- | src/mbgl/text/collision_feature.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/mbgl/text/collision_feature.cpp b/src/mbgl/text/collision_feature.cpp index 6d6f2aabc7..9c934624d4 100644 --- a/src/mbgl/text/collision_feature.cpp +++ b/src/mbgl/text/collision_feature.cpp @@ -1,5 +1,6 @@ #include <mbgl/text/collision_feature.hpp> #include <mbgl/util/math.hpp> +#include <mbgl/math/log2.hpp> namespace mbgl { @@ -50,7 +51,7 @@ void CollisionFeature::bboxifyLabel(const GeometryCoordinates& line, GeometryCoo // symbol spacing will put labels very close together in a pitched map. // To reduce the cost of adding extra collision circles, we slowly increase // them for overscaled tiles. - const float overscalingPaddingFactor = 1 + .4 * std::log(overscaling) / std::log(2); + const float overscalingPaddingFactor = 1 + .4 * ::log2(static_cast<double>(overscaling)); const int nPitchPaddingBoxes = std::floor(nBoxes * overscalingPaddingFactor / 2); // offset the center of the first box by half a box so that the edge of the |