From 322ac1c20cfc1ad79abaa8032f747ce94108975c Mon Sep 17 00:00:00 2001 From: german77 Date: Tue, 13 Jun 2023 00:13:42 -0600 Subject: android: Fix touch input --- .../src/main/java/org/yuzu/yuzu_emu/views/FixedRatioSurfaceView.kt | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/android/app/src/main/java/org/yuzu/yuzu_emu/views/FixedRatioSurfaceView.kt b/src/android/app/src/main/java/org/yuzu/yuzu_emu/views/FixedRatioSurfaceView.kt index c8ef8c1fd..d89a89983 100644 --- a/src/android/app/src/main/java/org/yuzu/yuzu_emu/views/FixedRatioSurfaceView.kt +++ b/src/android/app/src/main/java/org/yuzu/yuzu_emu/views/FixedRatioSurfaceView.kt @@ -38,9 +38,11 @@ class FixedRatioSurfaceView @JvmOverloads constructor( newWidth = width newHeight = (width / aspectRatio).roundToInt() } - setMeasuredDimension(newWidth, newHeight) + val left = (width - newWidth) / 2; + val top = (height - newHeight) / 2; + setLeftTopRightBottom(left, top, left + newWidth, top + newHeight) } else { - setMeasuredDimension(width, height) + setLeftTopRightBottom(0, 0, width, height) } } } -- cgit v1.2.3