During a LayoutAnimation.spring animation it's possible for the SvgView to have negative layout dimensions when used with 100% width/height. Check for negative dimensions before calling Bitmap.createBitmap.

This commit is contained in:
Mark Lord
2019-02-06 11:06:01 +00:00
parent 24e467d202
commit 727a2d0937
@@ -234,7 +234,7 @@ public class SvgView extends ReactViewGroup implements ReactCompoundView, ReactC
height = (float) PropHelper.fromRelative(mbbHeight, parentHeight, 0, mScale, 12);
setMeasuredDimension((int)Math.ceil(width), (int)Math.ceil(height));
}
if (width == 0 || height == 0) {
if (width <= 0 || height <= 0) {
return null;
}
Bitmap bitmap = Bitmap.createBitmap(