Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Make shaders clamp perspective ratio to reasonable ranges.
This fixes issue #6363, but also guards against a class of bugs: We previously relied on the assumption that the perspective ratio was calculated with the same anchor point as the item we were drawing. If that assumption was violated, it was possible for overzoomed items far outside of the viewport to grow larger faster than they moved away from the viewport. They could eventually grow large enough to cover the viewport entirely, causing brief "flashes" during map animations. This commit does _not_ clamp the perspective ratios on the CPU side, to avoid extra work in the inner loop of very performance sensitive collision/projection code. On the collision side, anything far outside of the viewport should be collided/ignored anyway, and on the projection side, we have a filter requiring that the anchor of the label be within the viewport before the projection logic begins.
- Loading branch information