[android] - avoid rounding the pixelratio of the image addded through NativeMapView#addImage

This commit is contained in:
Tobrun
2018-05-07 11:26:05 +02:00
committed by Tobrun
parent 8c00a41708
commit b6f56db4fe

View File

@@ -772,8 +772,9 @@ final class NativeMapView {
return;
}
// Determine pixel ratio
nativeAddImage(name, image, image.getDensity() / DisplayMetrics.DENSITY_DEFAULT);
// Determine pixel ratio, cast to float to avoid rounding, see mapbox-gl-native/issues/11809
float pixelRatio = (float) image.getDensity() / DisplayMetrics.DENSITY_DEFAULT;
nativeAddImage(name, image, pixelRatio);
}
public void addImages(@NonNull HashMap<String, Bitmap> bitmapHashMap) {