diff --git a/src/mbgl/layout/symbol_layout.cpp b/src/mbgl/layout/symbol_layout.cpp index 07ba2bf4a3f..a7107ef958e 100644 --- a/src/mbgl/layout/symbol_layout.cpp +++ b/src/mbgl/layout/symbol_layout.cpp @@ -515,8 +515,8 @@ void SymbolLayout::addToDebugBuffers(CollisionTile& collisionTile, SymbolBucket& bl = util::matrixMultiply(collisionTile.reverseRotationMatrix, bl); br = util::matrixMultiply(collisionTile.reverseRotationMatrix, br); - const float maxZoom = util::clamp(zoom + log(box.maxScale) / log(2), util::MIN_ZOOM, util::MAX_ZOOM); - const float placementZoom = util::clamp(zoom + log(box.placementScale) / log(2), util::MIN_ZOOM, util::MAX_ZOOM); + const float maxZoom = util::clamp(zoom + util::log2(box.maxScale), util::MIN_ZOOM, util::MAX_ZOOM); + const float placementZoom = util::clamp(zoom + util::log2(box.placementScale), util::MIN_ZOOM, util::MAX_ZOOM); collisionBox.vertices.emplace_back(anchor.x, anchor.y, tl.x, tl.y, maxZoom, placementZoom); collisionBox.vertices.emplace_back(anchor.x, anchor.y, tr.x, tr.y, maxZoom, placementZoom); diff --git a/src/mbgl/map/transform_state.cpp b/src/mbgl/map/transform_state.cpp index 4f6bcecdb6c..1dacdf8fc37 100644 --- a/src/mbgl/map/transform_state.cpp +++ b/src/mbgl/map/transform_state.cpp @@ -120,7 +120,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 {