Fix pen rotation values

This commit is contained in:
Cameron Gutman 2023-06-25 00:26:32 -05:00
parent d1579e9b0d
commit daaa7f4e63
2 changed files with 4 additions and 1 deletions

View File

@ -1525,6 +1525,9 @@ public class Game extends Activity implements SurfaceHolder.Callback,
if (dev != null) { if (dev != null) {
if (dev.getMotionRange(MotionEvent.AXIS_ORIENTATION, event.getSource()) != null) { if (dev.getMotionRange(MotionEvent.AXIS_ORIENTATION, event.getSource()) != null) {
rotationDegrees = (short)Math.toDegrees(event.getOrientation(event.getActionIndex())); rotationDegrees = (short)Math.toDegrees(event.getOrientation(event.getActionIndex()));
if (rotationDegrees < 0) {
rotationDegrees += 360;
}
} }
if (dev.getMotionRange(MotionEvent.AXIS_TILT, event.getSource()) != null) { if (dev.getMotionRange(MotionEvent.AXIS_TILT, event.getSource()) != null) {
tiltDegrees = (byte)Math.toDegrees(event.getAxisValue(MotionEvent.AXIS_TILT, event.getActionIndex())); tiltDegrees = (byte)Math.toDegrees(event.getAxisValue(MotionEvent.AXIS_TILT, event.getActionIndex()));

@ -1 +1 @@
Subproject commit c8aac7f71cc0a94f3edbc2fad27a0915cad6fa16 Subproject commit 44c8b95400db3664a087d346297232685c565f85