fix touch events within the elements which are nested in G

This commit is contained in:
Horcrux
2016-08-06 21:37:58 +08:00
parent 76a51f1f47
commit 7f4eb47f81
17 changed files with 123 additions and 121 deletions
+2 -7
View File
@@ -71,10 +71,7 @@
{
CGRect rect = [self getRect:context];
// add hit area
self.hitArea = CGPathCreateMutable();
CGPathRef path = CGPathCreateWithRect(rect, nil);
CGPathAddPath(self.hitArea, nil, path);
CGPathRelease(path);
self.hitArea = CGPathCreateWithRect(rect, nil);
[self clip:context];
CGContextSaveGState(context);
@@ -97,9 +94,7 @@
- (CGPathRef)getPath:(CGContextRef)context
{
CGMutablePathRef path = CGPathCreateMutable();
CGPathAddRect(path, nil, [self getRect:context]);
return (CGPathRef)CFAutorelease(path);
return CGPathCreateWithRect([self getRect:context], nil);
}
@end