[ios] Measure paths even with fill="none" fixes #907

This commit is contained in:
Mikael Sand
2019-01-22 18:23:03 +02:00
parent eeae255fdd
commit 46f96d115b
2 changed files with 18 additions and 16 deletions
+10 -8
View File
@@ -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];
}
+8 -8
View File
@@ -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];