mirror of
https://github.com/zoriya/react-native-svg.git
synced 2026-06-05 07:59:28 +00:00
@@ -221,20 +221,8 @@ public class SvgView extends ReactViewGroup implements ReactCompoundView, ReactC
|
||||
mRendered = true;
|
||||
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) {
|
||||
boolean invalid = Float.isNaN(width) || Float.isNaN(height) || width < 1 || height < 1 || (Math.log10(width) + Math.log10(height) > 42);
|
||||
if (invalid) {
|
||||
return null;
|
||||
}
|
||||
Bitmap bitmap = Bitmap.createBitmap(
|
||||
|
||||
Reference in New Issue
Block a user