mirror of
https://github.com/zhigang1992/react-native.git
synced 2026-02-11 22:32:38 +08:00
Update touch/measure/hotspot to all use same coordinate space
Reviewed By: astreet Differential Revision: D2731165 fb-gh-sync-id: 729943233af66f139907cac2002fed4038b3fa6a
This commit is contained in:
committed by
facebook-github-bot-5
parent
423202072c
commit
5775d9e1d0
@@ -466,8 +466,15 @@ public class NativeViewHierarchyManager {
|
||||
throw new NoSuchNativeViewException("No native view for " + tag + " currently exists");
|
||||
}
|
||||
|
||||
// Puts x/y in outputBuffer[0]/[1]
|
||||
v.getLocationOnScreen(outputBuffer);
|
||||
View rootView = (View) RootViewUtil.getRootView(v);
|
||||
rootView.getLocationInWindow(outputBuffer);
|
||||
int rootX = outputBuffer[0];
|
||||
int rootY = outputBuffer[1];
|
||||
|
||||
v.getLocationInWindow(outputBuffer);
|
||||
|
||||
outputBuffer[0] = outputBuffer[0] - rootX;
|
||||
outputBuffer[1] = outputBuffer[1] - rootY;
|
||||
outputBuffer[2] = v.getWidth();
|
||||
outputBuffer[3] = v.getHeight();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user