소스 검색

Merge pull request #10751 from german77/touch

android: Fix touch input
Charles Lombardo 3 년 전
부모
커밋
0644c9d6cb
1개의 변경된 파일4개의 추가작업 그리고 2개의 파일을 삭제
  1. 4 2
      src/android/app/src/main/java/org/yuzu/yuzu_emu/views/FixedRatioSurfaceView.kt

+ 4 - 2
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)
         }
     }
 }