Add RenderableView, fix names. Allow percentages in nested SVG (iOS).

This commit is contained in:
Mikael Sand
2018-03-17 23:22:40 +02:00
parent a3c9aa2872
commit 7deabf8287
4 changed files with 41 additions and 7 deletions
+3 -1
View File
@@ -52,7 +52,9 @@
}
} else if ([node isKindOfClass:[RNSVGSvgView class]]) {
RNSVGSvgView* svgView = (RNSVGSvgView*)node;
CGRect rect = CGRectMake(0, 0, [svgView.bbWidth floatValue], [svgView.bbHeight floatValue]);
CGFloat width = [self relativeOnWidth:svgView.bbWidth];
CGFloat height = [self relativeOnHeight:svgView.bbHeight];
CGRect rect = CGRectMake(0, 0, width, height);
CGContextClipToRect(context, rect);
[svgView drawToContext:context withRect:(CGRect)rect];
} else {