Last active
January 19, 2022 03:15
-
-
Save shinyquagsire23/bc7cd198745e6d305716aaa679f9c19e to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff -r /home/maxamillion/workspace/qt5_compare/qt-everywhere-src-5.12.2/qtbase/src/android/jar/src/org/qtproject/qt5/android/QtNative.java ./qtbase/src/android/jar/src/org/qtproject/qt5/android/QtNative.java | |
491a492,495 | |
> float tiltRot = event.getAxisValue(MotionEvent.AXIS_TILT); | |
> float orientation = event.getAxisValue(MotionEvent.AXIS_ORIENTATION); | |
> float tiltX = (float) Math.toDegrees(-Math.sin(orientation) * tiltRot); | |
> float tiltY = (float) Math.toDegrees(Math.cos(orientation) * tiltRot); | |
493c497 | |
< event.getButtonState(), event.getX(), event.getY(), event.getPressure()); | |
--- | |
> event.getButtonState(), event.getX(), event.getY(), event.getPressure(), tiltX, tiltY, (float)Math.toDegrees(orientation)); | |
1025c1029 | |
< public static native void tabletEvent(int winId, int deviceId, long time, int action, int pointerType, int buttonState, float x, float y, float pressure); | |
--- | |
> public static native void tabletEvent(int winId, int deviceId, long time, int action, int pointerType, int buttonState, float x, float y, float pressure, float tiltX, float tiltY, float rotation); | |
diff -r /home/maxamillion/workspace/qt5_compare/qt-everywhere-src-5.12.2/qtbase/src/plugins/platforms/android/androidjniinput.cpp ./qtbase/src/plugins/platforms/android/androidjniinput.cpp | |
321c321 | |
< jint pointerType, jint buttonState, jfloat x, jfloat y, jfloat pressure) | |
--- | |
> jint pointerType, jint buttonState, jfloat x, jfloat y, jfloat pressure, jfloat tiltX, jfloat tiltY, jfloat rotation) | |
364c367 | |
< buttons, pressure, 0, 0, 0., 0., 0, deviceId, Qt::NoModifier); | |
--- | |
> buttons, pressure, tiltX, tiltY, 0., rotation, 0, deviceId, Qt::NoModifier); | |
869c872 | |
< {"tabletEvent", "(IIJIIIFFF)V", (void *)tabletEvent}, | |
--- | |
> {"tabletEvent", "(IIJIIIFFFFFF)V", (void *)tabletEvent}, |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Thanks for the tilt transform is vary helpful.