From daaa7f4e63b6c11c20f3ae9eeabb87a2af6b1611 Mon Sep 17 00:00:00 2001 From: Cameron Gutman Date: Sun, 25 Jun 2023 00:26:32 -0500 Subject: [PATCH] Fix pen rotation values --- app/src/main/java/com/limelight/Game.java | 3 +++ app/src/main/jni/moonlight-core/moonlight-common-c | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/com/limelight/Game.java b/app/src/main/java/com/limelight/Game.java index 71a5907f..6e550d3c 100644 --- a/app/src/main/java/com/limelight/Game.java +++ b/app/src/main/java/com/limelight/Game.java @@ -1525,6 +1525,9 @@ public class Game extends Activity implements SurfaceHolder.Callback, if (dev != null) { if (dev.getMotionRange(MotionEvent.AXIS_ORIENTATION, event.getSource()) != null) { rotationDegrees = (short)Math.toDegrees(event.getOrientation(event.getActionIndex())); + if (rotationDegrees < 0) { + rotationDegrees += 360; + } } if (dev.getMotionRange(MotionEvent.AXIS_TILT, event.getSource()) != null) { tiltDegrees = (byte)Math.toDegrees(event.getAxisValue(MotionEvent.AXIS_TILT, event.getActionIndex())); diff --git a/app/src/main/jni/moonlight-core/moonlight-common-c b/app/src/main/jni/moonlight-core/moonlight-common-c index c8aac7f7..44c8b954 160000 --- a/app/src/main/jni/moonlight-core/moonlight-common-c +++ b/app/src/main/jni/moonlight-core/moonlight-common-c @@ -1 +1 @@ -Subproject commit c8aac7f71cc0a94f3edbc2fad27a0915cad6fa16 +Subproject commit 44c8b95400db3664a087d346297232685c565f85