mirror of
https://github.com/zhigang1992/react-native.git
synced 2026-04-27 19:25:11 +08:00
hit test detection -- adding clipsToBounds testing
Summary: This addresses #3577 and #3533. It adds the ability to test for subview.clipsToBounds. Closes https://github.com/facebook/react-native/pull/3750 Reviewed By: svcscm Differential Revision: D2592878 Pulled By: nicklockwood fb-gh-sync-id: a87842b87dc0b455120e6007059b5d9a51a53ea2
This commit is contained in:
committed by
facebook-github-bot-5
parent
ffc6db2f2c
commit
ca7a8b271a
@@ -19,7 +19,7 @@
|
||||
static UIView *RCTViewHitTest(UIView *view, CGPoint point, UIEvent *event)
|
||||
{
|
||||
for (UIView *subview in [view.subviews reverseObjectEnumerator]) {
|
||||
if (!subview.isHidden && subview.isUserInteractionEnabled && subview.alpha > 0) {
|
||||
if (!subview.clipsToBounds && !subview.isHidden && subview.isUserInteractionEnabled && subview.alpha > 0) {
|
||||
CGPoint convertedPoint = [subview convertPoint:point fromView:view];
|
||||
UIView *subviewHitTestView = [subview hitTest:convertedPoint withEvent:event];
|
||||
if (subviewHitTestView != nil) {
|
||||
|
||||
Reference in New Issue
Block a user