Skip to content

Commit 45244eb

Browse files
ryancatfacebook-github-bot
authored andcommitted
Fix TouchTargetHelper to correctly use the overflowInset information
Summary: The overflowInset uses negative values to indicate extending from parent view. This diff fixes the math so that it's correctly check if the point is within overflowInset. Changelog [Android][Fixed] - Fix math for detecting if children views are in parent's overflowInset area. Reviewed By: genkikondo Differential Revision: D33750129 fbshipit-source-id: 1a5a33a227280c687b158b4a81a56017b6f4f3e0
1 parent 86fa2a5 commit 45244eb

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

ReactAndroid/src/main/java/com/facebook/react/uimanager/TouchTargetHelper.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -271,8 +271,8 @@ private static boolean isTouchPointInViewWithOverflowInset(float x, float y, Vie
271271
}
272272

273273
final Rect overflowInset = ((ReactOverflowViewWithInset) view).getOverflowInset();
274-
return (x >= -overflowInset.left && x < view.getWidth() - overflowInset.right)
275-
&& (y >= -overflowInset.top && y < view.getHeight() - overflowInset.bottom);
274+
return (x >= overflowInset.left && x < view.getWidth() - overflowInset.right)
275+
&& (y >= overflowInset.top && y < view.getHeight() - overflowInset.bottom);
276276
}
277277

278278
/**

0 commit comments

Comments
 (0)