mirror of
https://github.com/zoriya/react-native-svg.git
synced 2026-05-12 23:34:55 +00:00
refactor(ios): only invalidate foreignObject on did mount if not ready
This commit is contained in:
@@ -40,12 +40,20 @@
|
||||
- (void)uiManagerDidPerformMounting:(RCTUIManager *)manager
|
||||
{
|
||||
[manager addUIBlock:^(__unused RCTUIManager *uiManager, __unused NSDictionary<NSNumber *, UIView *> *viewRegistry) {
|
||||
if (!self->_ready && !self.dirty) {
|
||||
if (!self->_ready) {
|
||||
[self invalidate];
|
||||
}
|
||||
}];
|
||||
}
|
||||
|
||||
- (void)renderChildTo:(CGContextRef)context rect:(CGRect)rect node:(UIView*)node
|
||||
{
|
||||
node.hidden = false;
|
||||
self->_ready = [node drawViewHierarchyInRect:rect afterScreenUpdates:true];
|
||||
[node.layer renderInContext:context];
|
||||
node.hidden = true;
|
||||
}
|
||||
|
||||
- (void)renderLayerTo:(CGContextRef)context rect:(CGRect)rect
|
||||
{
|
||||
[self clip:context];
|
||||
|
||||
@@ -20,6 +20,7 @@
|
||||
|
||||
- (void)renderPathTo:(CGContextRef)context rect:(CGRect)rect;
|
||||
- (void)renderGroupTo:(CGContextRef)context rect:(CGRect)rect;
|
||||
- (void)renderChildTo:(CGContextRef)context rect:(CGRect)rect node:(UIView*)node;
|
||||
|
||||
- (RNSVGGlyphContext *)getGlyphContext;
|
||||
- (void)pushGlyphContext;
|
||||
|
||||
@@ -72,9 +72,7 @@
|
||||
CGContextClipToRect(context, rect);
|
||||
[svgView drawToContext:context withRect:rect];
|
||||
} else {
|
||||
node.hidden = false;
|
||||
[node.layer renderInContext:context];
|
||||
node.hidden = true;
|
||||
[self renderChildTo:context rect:rect node:node];
|
||||
}
|
||||
|
||||
return YES;
|
||||
@@ -107,6 +105,13 @@
|
||||
[self popGlyphContext];
|
||||
}
|
||||
|
||||
- (void)renderChildTo:(CGContextRef)context rect:(CGRect)rect node:(UIView*)node
|
||||
{
|
||||
node.hidden = false;
|
||||
[node.layer renderInContext:context];
|
||||
node.hidden = true;
|
||||
}
|
||||
|
||||
- (void)setupGlyphContext:(CGContextRef)context
|
||||
{
|
||||
CGRect clipBounds = CGContextGetClipBoundingBox(context);
|
||||
|
||||
Reference in New Issue
Block a user