浏览代码

Android: fix coordinates for Surface.ROTATION_180
https://discourse.libsdl.org/t/android-screen-orientation-issues-2-0-9/26262

Sylvain Becker 6 年之前
父节点
当前提交
4392c6ff14
共有 1 个文件被更改,包括 2 次插入2 次删除
  1. 2 2
      android-project/app/src/main/java/org/libsdl/app/SDLActivity.java

+ 2 - 2
android-project/app/src/main/java/org/libsdl/app/SDLActivity.java

@@ -1971,8 +1971,8 @@ class SDLSurface extends SurfaceView implements SurfaceHolder.Callback,
                     newOrientation = SDLActivity.SDL_ORIENTATION_LANDSCAPE_FLIPPED;
                     break;
                 case Surface.ROTATION_180:
-                    x = -event.values[1];
-                    y = -event.values[0];
+                    x = -event.values[0];
+                    y = -event.values[1];
                     newOrientation = SDLActivity.SDL_ORIENTATION_PORTRAIT_FLIPPED;
                     break;
                 default: