Skip to content
This repository has been archived by the owner on Mar 26, 2021. It is now read-only.

Commit

Permalink
[ANMA-8545] restore tilt limit when there is padding
Browse files Browse the repository at this point in the history
  • Loading branch information
pmerletmappy committed Apr 27, 2020
1 parent df63126 commit 83229cc
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/mbgl/map/transform.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -651,7 +651,7 @@ double Transform::getMaxPitchForEdgeInsets(const EdgeInsets& insets) const {
// We use half of fov, as it is field of view above perspective center.
// With inset, this angle changes and tangentOfFovAboveCenterAngle = (h/2 + centerOffsetY) / (height * 1.5).
// 1.03 is a bit extra added to prevent parallel ground to viewport clipping plane.
const double tangentOfFovAboveCenterAngle = 1.03 * (height / 2.0 + centerOffsetY * 2.5) / (1.5 * height);
const double tangentOfFovAboveCenterAngle = 1.03 * (height / 2.0 + centerOffsetY) / (1.5 * height);
const double fovAboveCenter = std::atan(tangentOfFovAboveCenterAngle);
return M_PI * 0.5 - fovAboveCenter;
// e.g. Maximum pitch of 60 degrees is when perspective center's offset from the top is 84% of screen height.
Expand Down

0 comments on commit 83229cc

Please sign in to comment.