Fix coordinates of touch.pageX/pageY coordinates when RCTRootView is not at the origin of the NSWindow (#1619)

* Update scripts to publish react-native-macos-init

* Clean up merge markers

* Restored ios:macos RNTester parity except for InputAccessoryView.

* Revert "Restored ios:macos RNTester parity except for InputAccessoryView."

This reverts commit 5a67ae06b0.

* Remove unnecessary android builds and tar file upload.

* Fix coordinates of touch.pageX/pageY coordinates when RCTRootView is not at the origin of the NSWindow

Co-authored-by: React-Native Bot <53619745+rnbot@users.noreply.github.com>
This commit is contained in:
Tom Underhill 2023-01-06 09:48:24 +01:00 коммит произвёл GitHub
Родитель 0ce8502c18
Коммит d7b689f90b
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 4AEE18F83AFDEB23
1 изменённых файлов: 2 добавлений и 1 удалений

Просмотреть файл

@ -228,7 +228,8 @@ RCT_NOT_IMPLEMENTED(- (instancetype)initWithCoder:(NSCoder *)coder)
#else // [TODO(macOS GH#774)
NSEvent *nativeTouch = _nativeTouches[touchIndex];
CGPoint location = nativeTouch.locationInWindow;
CGPoint rootViewLocation = CGPointMake(location.x, CGRectGetHeight(self.view.window.frame) - location.y);
RCTAssert(_cachedRootView, @"We were unable to find a root view for the touch");
CGPoint rootViewLocation = [_cachedRootView.window.contentView convertPoint:location toView:_cachedRootView];
NSView *touchView = _touchViews[touchIndex];
CGPoint touchViewLocation = [touchView convertPoint:location fromView:nil];
#endif // ]TODO(macOS GH#774)