From 56e2dbc6198125bbc26ff7aef11a0c0e435400d4 Mon Sep 17 00:00:00 2001 From: xbzk Date: Mon, 13 Oct 2025 15:37:41 +0200 Subject: [PATCH] added barriers against zero valued overlayControlData.individualScale (#2721) Some recent change already in master caused some @android users to reach a state in which they were missing individualScale value to some input overlay controls. I was affected, and some fella in #tester-chat even shared a video. These 3 new barriers makes eden ignore individualScales if they're zeroed (feeding 1f instead), avoiding the crash, and allowing users to further adjust controls scales. Safe and functional. Co-authored-by: Allison Cunha Reviewed-on: https://git.eden-emu.dev/eden-emu/eden/pulls/2721 Reviewed-by: Lizzie Reviewed-by: Shinmegumi Co-authored-by: xbzk Co-committed-by: xbzk --- .../src/main/java/org/yuzu/yuzu_emu/overlay/InputOverlay.kt | 6 +++--- 1 file changed, 3 insertions(+), 3 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 9f050a5053..256e5968d1 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 @@ -1039,7 +1039,7 @@ class InputOverlay(context: Context, attrs: AttributeSet?) : scale /= 100f // Apply individual scale - scale *= overlayControlData.individualScale + scale *= overlayControlData.individualScale.let { if (it > 0f) it else 1f } // Initialize the InputOverlayDrawableButton. val defaultStateBitmap = getBitmap(context, defaultResId, scale) @@ -1114,7 +1114,7 @@ class InputOverlay(context: Context, attrs: AttributeSet?) : // Apply individual scale if (dpadData != null) { - scale *= dpadData.individualScale + scale *= dpadData.individualScale.let { if (it > 0f) it else 1f } } // Initialize the InputOverlayDrawableDpad. @@ -1191,7 +1191,7 @@ class InputOverlay(context: Context, attrs: AttributeSet?) : scale /= 100f // Apply individual scale - scale *= overlayControlData.individualScale + scale *= overlayControlData.individualScale.let { if (it > 0f) it else 1f } // Initialize the InputOverlayDrawableJoystick. val bitmapOuter = getBitmap(context, resOuter, scale)