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

Commit 60f2ea1

Browse files
committed
[ANMA-8545] Duplicate Mapbox request mapbox#16448
1 parent 83229cc commit 60f2ea1

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

src/mbgl/map/transform.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -651,7 +651,9 @@ double Transform::getMaxPitchForEdgeInsets(const EdgeInsets& insets) const {
651651
// We use half of fov, as it is field of view above perspective center.
652652
// With inset, this angle changes and tangentOfFovAboveCenterAngle = (h/2 + centerOffsetY) / (height * 1.5).
653653
// 1.03 is a bit extra added to prevent parallel ground to viewport clipping plane.
654-
const double tangentOfFovAboveCenterAngle = 1.03 * (height / 2.0 + centerOffsetY) / (1.5 * height);
654+
// * Mappy Modif : 2.4 is an arbitrary factor to prevent too much depth when the top offset is important.
655+
// * See https://github.com/mapbox/mapbox-gl-native/pull/16448
656+
const double tangentOfFovAboveCenterAngle = 1.03 * (height / 2.0 + centerOffsetY * 2.4) / (1.5 * height);
655657
const double fovAboveCenter = std::atan(tangentOfFovAboveCenterAngle);
656658
return M_PI * 0.5 - fovAboveCenter;
657659
// e.g. Maximum pitch of 60 degrees is when perspective center's offset from the top is 84% of screen height.

0 commit comments

Comments
 (0)