mirror of
https://github.com/zoriya/react-native-svg.git
synced 2026-05-26 04:19:17 +00:00
Optimize group hitTest
This commit is contained in:
@@ -111,7 +111,7 @@
|
||||
|
||||
- (UIView *)hitTest:(CGPoint)point withEvent:(UIEvent *)event
|
||||
{
|
||||
CGPoint transformed = CGPointApplyAffineTransform(point, CGAffineTransformInvert(self.matrix));
|
||||
CGPoint transformed = CGPointApplyAffineTransform(point, self.invmatrix);
|
||||
|
||||
UIView *hitSelf = [super hitTest:transformed withEvent:event];
|
||||
if (hitSelf) {
|
||||
@@ -119,11 +119,8 @@
|
||||
}
|
||||
|
||||
CGPathRef clip = [self getClipPath];
|
||||
if (clip) {
|
||||
BOOL insideClipPath = CGPathContainsPoint(clip, nil, transformed, self.clipRule == kRNSVGCGFCRuleEvenodd);
|
||||
if (!insideClipPath) {
|
||||
return nil;
|
||||
}
|
||||
if (clip && !CGPathContainsPoint(clip, nil, transformed, self.clipRule == kRNSVGCGFCRuleEvenodd)) {
|
||||
return nil;
|
||||
}
|
||||
|
||||
for (RNSVGNode *node in [self.subviews reverseObjectEnumerator]) {
|
||||
|
||||
Reference in New Issue
Block a user