This repository was archived by the owner on Mar 26, 2021. It is now read-only.
File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff 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.
You can’t perform that action at this time.
0 commit comments