summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorgerman77 <juangerman-13@hotmail.com>2023-04-09 21:34:33 +0200
committerbunnei <bunneidev@gmail.com>2023-06-03 09:05:50 +0200
commit5aec62930c6eece372a48fd36c959ea01521ef10 (patch)
treee492c3da56b990b35d761561fc46d79d488b7d3f /src
parentandroid: Scale input overlay independently of system display scale (diff)
downloadyuzu-5aec62930c6eece372a48fd36c959ea01521ef10.tar
yuzu-5aec62930c6eece372a48fd36c959ea01521ef10.tar.gz
yuzu-5aec62930c6eece372a48fd36c959ea01521ef10.tar.bz2
yuzu-5aec62930c6eece372a48fd36c959ea01521ef10.tar.lz
yuzu-5aec62930c6eece372a48fd36c959ea01521ef10.tar.xz
yuzu-5aec62930c6eece372a48fd36c959ea01521ef10.tar.zst
yuzu-5aec62930c6eece372a48fd36c959ea01521ef10.zip
Diffstat (limited to 'src')
-rw-r--r--src/android/app/src/main/java/org/yuzu/yuzu_emu/overlay/InputOverlay.kt6
1 files changed, 2 insertions, 4 deletions
diff --git a/src/android/app/src/main/java/org/yuzu/yuzu_emu/overlay/InputOverlay.kt b/src/android/app/src/main/java/org/yuzu/yuzu_emu/overlay/InputOverlay.kt
index 895d33abf..c0dc8ce76 100644
--- a/src/android/app/src/main/java/org/yuzu/yuzu_emu/overlay/InputOverlay.kt
+++ b/src/android/app/src/main/java/org/yuzu/yuzu_emu/overlay/InputOverlay.kt
@@ -8,10 +8,8 @@ import android.content.Context
import android.content.SharedPreferences
import android.content.res.Configuration
import android.graphics.Bitmap
-import android.graphics.BitmapFactory
import android.graphics.Canvas
import android.graphics.Rect
-import android.graphics.drawable.BitmapDrawable
import android.graphics.drawable.Drawable
import android.graphics.drawable.VectorDrawable
import android.hardware.Sensor
@@ -606,8 +604,8 @@ class InputOverlay(context: Context, attrs: AttributeSet?) : SurfaceView(context
// If we have API access, calculate the safe area to draw the overlay
var cutoutLeft = 0
var cutoutBottom = 0
- if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.Q) {
- val insets = windowInsets.displayCutout!!
+ val insets = windowInsets.displayCutout
+ if (insets != null && Build.VERSION.SDK_INT >= Build.VERSION_CODES.Q) {
maxY =
if (insets.boundingRectTop.bottom != 0) insets.boundingRectTop.bottom.toFloat() else maxY
maxX =