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
This commit is contained in:
Xin Chen
2022-01-26 19:23:13 -08:00
committed by Facebook GitHub Bot
parent 86fa2a5106
commit 45244ebce2
@@ -271,8 +271,8 @@ public class TouchTargetHelper {
}
final Rect overflowInset = ((ReactOverflowViewWithInset) view).getOverflowInset();
return (x >= -overflowInset.left && x < view.getWidth() - overflowInset.right)
&& (y >= -overflowInset.top && y < view.getHeight() - overflowInset.bottom);
return (x >= overflowInset.left && x < view.getWidth() - overflowInset.right)
&& (y >= overflowInset.top && y < view.getHeight() - overflowInset.bottom);
}
/**