From 9a250c0608a94606d963203462f8c6c437dea54e Mon Sep 17 00:00:00 2001 From: Caleb Chiesa Date: Mon, 4 Feb 2019 11:53:01 -0800 Subject: [PATCH] Prevents early rendering. Related to #921. --- android/src/main/java/com/horcrux/svg/SvgView.java | 14 +------------- 1 file changed, 1 insertion(+), 13 deletions(-) diff --git a/android/src/main/java/com/horcrux/svg/SvgView.java b/android/src/main/java/com/horcrux/svg/SvgView.java index 1e6f6ea7..6735fb2d 100644 --- a/android/src/main/java/com/horcrux/svg/SvgView.java +++ b/android/src/main/java/com/horcrux/svg/SvgView.java @@ -222,19 +222,7 @@ public class SvgView extends ReactViewGroup implements ReactCompoundView, ReactC float width = getWidth(); float height = getHeight(); boolean early = Float.isNaN(width) || Float.isNaN(height) || width * height == 0 || (Math.log10(width) + Math.log10(height) > 42); - if (early) { - ViewParent viewParent = getParent(); - View parent = null; - if ((viewParent instanceof View)) { - parent = (View)viewParent; - } - float parentWidth = parent == null ? 0 : parent.getWidth(); - float parentHeight = parent == null ? 0 : parent.getHeight(); - width = (float) PropHelper.fromRelative(mbbWidth, parentWidth, 0, mScale, 12); - height = (float) PropHelper.fromRelative(mbbHeight, parentHeight, 0, mScale, 12); - setMeasuredDimension((int)Math.ceil(width), (int)Math.ceil(height)); - } - if (width == 0 || height == 0) { + if (early || width == 0 || height == 0) { return null; } Bitmap bitmap = Bitmap.createBitmap(