Skip to content
This repository has been archived by the owner on Aug 8, 2023. It is now read-only.

Commit

Permalink
[core] Reuse TransformState helpers
Browse files Browse the repository at this point in the history
  • Loading branch information
brunoabinader committed Oct 21, 2016
1 parent 8633c34 commit 6f3a220
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/mbgl/layout/symbol_layout.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion src/mbgl/map/transform_state.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit 6f3a220

Please sign in to comment.