File tree Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -224,8 +224,10 @@ - (void)_updateReactTouchAtIndex:(NSInteger)touchIndex
224
224
#else // [TODO(macOS GH#774)
225
225
NSEvent *nativeTouch = _nativeTouches[touchIndex];
226
226
CGPoint location = nativeTouch.locationInWindow ;
227
- CGPoint rootViewLocation = CGPointMake (location.x , CGRectGetHeight (self.view .window .frame ) - location.y );
228
- CGPoint touchViewLocation = rootViewLocation;
227
+ RCTAssert (_cachedRootView, @" We were unable to find a root view for the touch" );
228
+ CGPoint rootViewLocation = [_cachedRootView.window.contentView convertPoint: location toView: _cachedRootView];
229
+ NSView *touchView = _touchViews[touchIndex];
230
+ CGPoint touchViewLocation = [touchView convertPoint: location fromView: nil ];
229
231
#endif // ]TODO(macOS GH#774)
230
232
231
233
NSMutableDictionary *reactTouch = _reactTouches[touchIndex];
You can’t perform that action at this time.
0 commit comments