mirror of
https://github.com/zoriya/react-native-svg.git
synced 2026-06-09 01:25:01 +00:00
[ios] Measure paths even with fill="none" fixes #907
This commit is contained in:
@@ -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];
|
||||
}
|
||||
|
||||
@@ -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];
|
||||
|
||||
Reference in New Issue
Block a user