mirror of
https://github.com/zoriya/react-native-svg.git
synced 2026-06-04 23:54:53 +00:00
[android] fix rendering of nested svg
This commit is contained in:
@@ -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) {
|
||||||
|
|||||||
Reference in New Issue
Block a user