Prevents early rendering.

Related to #921.
This commit is contained in:
Caleb Chiesa
2019-02-04 11:53:01 -08:00
committed by GitHub
parent 24e467d202
commit 9a250c0608
@@ -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(