Fix for bug where mouse coordinates are wrong#239
Fix for bug where mouse coordinates are wrong#239russellmcc wants to merge 2 commits intoptmt:masterfrom
Conversation
This occurs when our main react view is not the contentView of a window. Touch coordinates are in window coordinates, but `hitTest` expects coordinates in the coordinate system of our superview. This is my first PR, let me know what I can do to get this in.
|
When does Also, please try out #228, which is the future of "touch" handling in react-native-macos. |
|
According to apple's docs, NSViews have a nil Thanks for the tip on #228! I'll try out the branch soon and let you know how it goes. |
|
I just checked, #228 first of all still has this problem, and additionally has another problem for clients that don't use RCTWindow - it seems that line 90 on RCTContentView.m on that branch flips the coordinate system - but this is inappropriate when not using RCTWindow. After removing this line, that branch showed the same problems as master. I can see what happens if I use RCTWindow instead, but in my use case I'm a view in a window someone else created, so this approach won't work for me. |
|
Sorry, I don't have the ability to move to RCTWindow as it stands now since my NSWindow is created long before my RCTBridge! |
This mirrors the behavior of upstream `react-native` for ios.
|
I've just added another, related commit to this branch; I hope that's okay. More than happy to split these out into separate PRs if that's more convenient for you. An explanation: I am trying to use lottie views as interactive controls. The current logic of checking if something is an |
|
Anyone had time to give this another look? I'm still motivated to land this; and am willing to help however I can! |
This occurs when our main react view is not the contentView of a
window. Touch coordinates are in window coordinates, but
hitTestexpects coordinates in the coordinate system of our superview.
This is my first PR, let me know what I can do to get this in.