From 727a2d093732f947751e3b81b99904823353bde8 Mon Sep 17 00:00:00 2001 From: Mark Lord Date: Wed, 6 Feb 2019 11:06:01 +0000 Subject: [PATCH] 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. --- android/src/main/java/com/horcrux/svg/SvgView.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/android/src/main/java/com/horcrux/svg/SvgView.java b/android/src/main/java/com/horcrux/svg/SvgView.java index 1e6f6ea7..bac74dbd 100644 --- a/android/src/main/java/com/horcrux/svg/SvgView.java +++ b/android/src/main/java/com/horcrux/svg/SvgView.java @@ -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(