[android] fix rendering of nested svg

This commit is contained in:
Mikael Sand
2018-07-02 05:23:50 +03:00
parent 7a43500b49
commit 2fa029035c
@@ -151,12 +151,15 @@ public class SvgViewShadowNode extends LayoutShadowNode {
mCanvas = canvas; mCanvas = canvas;
if (mAlign != null) { if (mAlign != null) {
RectF vbRect = getViewBox(); RectF vbRect = getViewBox();
float width = getLayoutWidth(); float width;
float height = getLayoutHeight(); float height;
boolean nested = Float.isNaN(width) || Float.isNaN(height); boolean nested = getNativeParent() instanceof SvgViewShadowNode;
if (nested) { if (nested) {
width = Float.parseFloat(mbbWidth) * mScale; width = Float.parseFloat(mbbWidth) * mScale;
height = Float.parseFloat(mbbHeight) * mScale; height = Float.parseFloat(mbbHeight) * mScale;
} else {
width = getLayoutWidth();
height = getLayoutHeight();
} }
RectF eRect = new RectF(0,0, width, height); RectF eRect = new RectF(0,0, width, height);
if (nested) { if (nested) {