mirror of
https://github.com/zoriya/react-native-svg.git
synced 2026-06-04 15:44:24 +00:00
[ios] Handle touches within use
This commit is contained in:
@@ -51,5 +51,21 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
- (UIView *)hitTest:(CGPoint)point withEvent:(UIEvent *)event {
|
||||||
|
const CGPoint transformed = CGPointApplyAffineTransform(point, self.invmatrix);
|
||||||
|
RNSVGNode const* template = [self.svgView getDefinedTemplate:self.href];
|
||||||
|
if (event) {
|
||||||
|
self.active = NO;
|
||||||
|
} else if (self.active) {
|
||||||
|
return self;
|
||||||
|
}
|
||||||
|
UIView const* hitChild = [template hitTest:transformed withEvent:event];
|
||||||
|
if (hitChild) {
|
||||||
|
self.active = YES;
|
||||||
|
return self;
|
||||||
|
}
|
||||||
|
return nil;
|
||||||
|
}
|
||||||
|
|
||||||
@end
|
@end
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user