[core] log2 polyfill for ARMv5

ARMv5 doesn't have a FPU and apparently the soft code for log2()
is wrong and giving weird results. log() works, so we use a log()
based log2() implementation for ARMv5.
This commit is contained in:
Thiago Marcos P. Santos
2016-06-06 16:11:22 +03:00
parent 7b8698b47a
commit 313d9ce09c
4 changed files with 15 additions and 3 deletions

View File

@@ -510,7 +510,7 @@ CameraOptions Map::cameraForLatLngs(const std::vector<LatLng>& latLngs, optional
scaleY -= (padding->top + padding->bottom) / height;
}
double minScale = ::fmin(scaleX, scaleY);
double zoom = ::log2(getScale() * minScale);
double zoom = util::log2(getScale() * minScale);
zoom = util::clamp(zoom, getMinZoom(), getMaxZoom());
// Calculate the center point of a virtual bounds that is extended in all directions by padding.