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 <allisonbzk@gmail.com> Reviewed-on: https://git.eden-emu.dev/eden-emu/eden/pulls/2721 Reviewed-by: Lizzie <lizzie@eden-emu.dev> Reviewed-by: Shinmegumi <shinmegumi@eden-emu.dev> Co-authored-by: xbzk <xbzk@eden-emu.dev> Co-committed-by: xbzk <xbzk@eden-emu.dev>
This commit is contained in:
parent
a3ef2cc183
commit
56e2dbc619
|
|
@ -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)
|
||||
|
|
|
|||
Loading…
Reference in New Issue