Merge pull request #7731 from zackhow/point

Android: Fix pointer if game aspect ratio is larger than device's
This commit is contained in:
Connor McLaughlin 2019-01-25 19:38:29 +10:00 committed by GitHub
commit af25b9aede
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 2 deletions

View File

@ -53,7 +53,7 @@ public class InputOverlayPointer
Float gameAR = NativeLibrary.GetGameAspectRatio(); Float gameAR = NativeLibrary.GetGameAspectRatio();
aspectAdjusted = gameAR / deviceAR; aspectAdjusted = gameAR / deviceAR;
if (gameAR < deviceAR) // Black bars on left/right if (gameAR <= deviceAR) // Black bars on left/right
{ {
xAdjusted = true; xAdjusted = true;
Integer gameX = Math.round((float) y * gameAR); Integer gameX = Math.round((float) y * gameAR);
@ -65,7 +65,7 @@ public class InputOverlayPointer
else // Bars on top/bottom else // Bars on top/bottom
{ {
xAdjusted = false; xAdjusted = false;
Integer gameY = Math.round((float) x * gameAR); Integer gameY = Math.round((float) x / gameAR);
Integer buffer = (y - gameY); Integer buffer = (y - gameY);
maxWidth = (float) x / 2; maxWidth = (float) x / 2;