[core] Moved util::log2 to its own header

- Added util::{MIN,MAX}_ZOOM_F to avoid consecutive conversions from
double to float
- Move util::log2 to its own header (part of mbgl/math)
This commit is contained in:
Bruno de Oliveira Abinader
2016-10-29 18:13:12 +03:00
parent a70bfd8910
commit 38f536049a
10 changed files with 43 additions and 29 deletions

View File

@@ -2,7 +2,7 @@
#include <mbgl/tile/tile_id.hpp>
#include <mbgl/util/constants.hpp>
#include <mbgl/util/interpolate.hpp>
#include <mbgl/util/math.hpp>
#include <mbgl/math/log2.hpp>
#include <mbgl/math/clamp.hpp>
namespace mbgl {
@@ -117,7 +117,7 @@ double TransformState::pixel_y() const {
#pragma mark - Zoom
double TransformState::getZoom() const {
return std::log(scale) / M_LN2;
return scaleZoom(scale);
}
int32_t TransformState::getIntegerZoom() const {