From ee9673618d1853eaf88263498d90f8c6c8c079ee Mon Sep 17 00:00:00 2001 From: Saad Najmi Date: Tue, 27 Jun 2023 17:47:27 -0700 Subject: [PATCH] port --- React/Base/RCTTouchHandler.m | 2 ++ 1 file changed, 2 insertions(+) diff --git a/React/Base/RCTTouchHandler.m b/React/Base/RCTTouchHandler.m index 5a409ec769a408..f020f0d45287d4 100644 --- a/React/Base/RCTTouchHandler.m +++ b/React/Base/RCTTouchHandler.m @@ -232,6 +232,8 @@ - (void)_updateReactTouchAtIndex:(NSInteger)touchIndex CGPoint rootViewLocation = [_cachedRootView.window.contentView convertPoint:location toView:_cachedRootView]; NSView *touchView = _touchViews[touchIndex]; CGPoint touchViewLocation = [touchView convertPoint:location fromView:nil]; + // JavaScript expects coordinates to have (0,0) at top left, unlike the macOS coordinate system + rootViewLocation.y = NSHeight([[_cachedRootView window] frame]) - rootViewLocation.y; #endif // macOS] NSMutableDictionary *reactTouch = _reactTouches[touchIndex];