diff --git a/ios/Elements/RNSVGGroup.m b/ios/Elements/RNSVGGroup.m index 59e1279f..4af3996e 100644 --- a/ios/Elements/RNSVGGroup.m +++ b/ios/Elements/RNSVGGroup.m @@ -72,17 +72,19 @@ return YES; }]; [self setHitArea:[self getPath:context]]; - self.clientRect = bounds; + if (!CGRectEqualToRect(bounds, CGRectNull)) { + self.clientRect = bounds; - CGAffineTransform transform = CGAffineTransformConcat(self.matrix, self.transforms); - CGPoint mid = CGPointMake(CGRectGetMidX(bounds), CGRectGetMidY(bounds)); - CGPoint center = CGPointApplyAffineTransform(mid, transform); + CGAffineTransform transform = CGAffineTransformConcat(self.matrix, self.transforms); + CGPoint mid = CGPointMake(CGRectGetMidX(bounds), CGRectGetMidY(bounds)); + CGPoint center = CGPointApplyAffineTransform(mid, transform); - self.bounds = bounds; - if (!isnan(center.x) && !isnan(center.y)) { - self.center = center; + self.bounds = bounds; + if (!isnan(center.x) && !isnan(center.y)) { + self.center = center; + } + self.frame = bounds; } - self.frame = bounds; [self popGlyphContext]; } diff --git a/ios/RNSVGRenderable.m b/ios/RNSVGRenderable.m index df716963..37741ffc 100644 --- a/ios/RNSVGRenderable.m +++ b/ios/RNSVGRenderable.m @@ -288,14 +288,6 @@ UInt32 saturate(CGFloat value) { - (void)renderLayerTo:(CGContextRef)context rect:(CGRect)rect { - if (!self.fill && !self.stroke) { - return; - } - - if (self.opacity == 0) { - return; - } - CGPathRef path = self.path; if (!path) { path = [self getPath:context]; @@ -329,6 +321,14 @@ UInt32 saturate(CGFloat value) { } self.frame = clientRect; + if (!self.fill && !self.stroke) { + return; + } + + if (self.opacity == 0) { + return; + } + CGPathDrawingMode mode = kCGPathStroke; BOOL fillColor = NO; [self clip:context];