mapbox-gl-native
mapbox-gl-native copied to clipboard
`CameraBoundsUpdate.getCameraPosition` incorrectly calculates bounds in some cases
CameraBoundsUpdate.getCameraPosition incorrectly calculates bounds in some cases.
This happens when projection.toScreenLocation() returns too big (positive or negative) result.
You need to replace this:
// Calculate the bounds of the possibly rotated shape with respect to the viewport
PointF nePixel = new PointF(-10000, -10000);
PointF swPixel = new PointF(10000, 10000);
by this:
// Calculate the bounds of the possibly rotated shape with respect to the viewport
PointF nePixel = new PointF(Float.MIN_VALUE, Float.MIN_VALUE);
PointF swPixel = new PointF(Float.MAX_VALUE, Float.MAX_VALUE);
This seems a valid one to include in 4.0.0. cc @bleege @zugaldia
Was bumped to 4.1.0 because it is not public API, picking this up now