Change NativeMapView to use 0 instead of throwing IllegalArgumentException when resizeView is called with a negative width or height (#151)
This commit is contained in:
@@ -150,11 +150,17 @@ final class NativeMapView implements NativeMap {
|
||||
height = (int) Math.ceil(height / pixelRatio);
|
||||
|
||||
if (width < 0) {
|
||||
throw new IllegalArgumentException("width cannot be negative.");
|
||||
Logger.e(TAG, String.format("Device returned a negative width size, "
|
||||
+ "setting value to 0 instead of %s", width)
|
||||
);
|
||||
width = 0;
|
||||
}
|
||||
|
||||
if (height < 0) {
|
||||
throw new IllegalArgumentException("height cannot be negative.");
|
||||
Logger.e(TAG, String.format("Device returned a negative height size, "
|
||||
+ "setting value to 0 instead of %s", height)
|
||||
);
|
||||
height = 0;
|
||||
}
|
||||
|
||||
if (width > 65535) {
|
||||
|
||||
Reference in New Issue
Block a user