Open smallnewer opened 5 years ago
NSWindow
usage with RCTWindow
.228 dos't work.😒
I change the hitTest
method of RCTView
,It can work for my demo now, but I think it also has some bugs. -.-
hope for your help.
- (NSView *)hitTest:(CGPoint)point
{
if ([self isHidden])
{
return nil;
}
NSPoint p = [self.layer convertPoint: point fromLayer: [self superview].layer];
for (NSView *subView in [[self subviews] reverseObjectEnumerator]) {
if (![subView isHidden]) {
NSView *v = [subView hitTest:p];
if (v) {
return v;
}
}
}
if ([self mouse:point inRect:self.layer.frame]) {
return self;
}
return nil;
}
There's definitely a bug in #228 that I'll be looking into sometime soon.
Just pushed some patches to #228. Lemme know if it works for you.
Is this a bug report?
yes
Have you read the Contributing Guidelines?
yes
Environment
Environment: OS: macOS High Sierra 10.13.6 Node: 8.3.0 Yarn: 1.12.3 npm: 5.3.0 Watchman: 4.9.0 Xcode: Xcode 10.1 Build version 10B61 Android Studio: Not Found
Packages: (wanted => installed) react: 16.2.0 => 16.2.0 react-native: Not Found
Target Platform: macos
Steps to Reproduce
react-native-macos init xxx
Expected Behavior
emit click in [100,300] of y.
Actual Behavior
emit click in [0, 200] of y.
code