Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Android: Fix crash when trying to edit gate size setting #12375

Merged
merged 1 commit into from Jan 7, 2024

Conversation

JosJuice
Copy link
Member

The gate size is 79.37125 by default, and the step size is 0.5. Android throws an exception if we try to show the slider with the value set to something that isn't divisible by the step size. To avoid this problem, round the value.

The gate size is 79.37125 by default, and the step size is 0.5. Android
throws an exception if we try to show the slider with the value set to
something that isn't divisible by the step size. To avoid this problem,
round the value.
settings,
BigDecimal((selection).toDouble()).round(MathContext(3)).toFloat()
)
floatSetting.setFloat(settings, selection)
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure why this rounding was being done. @t895, any comment?

Copy link
Contributor

@t895 t895 Dec 11, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this was an incorrect assumption about how precise our floating point settings were. This was from when I was trying to get float sliders to not break from precision issues for the color correction settings but when I try to use any float slider, things work fine in this build. Seems fine to me.

@JosJuice JosJuice merged commit 4e57b66 into dolphin-emu:master Jan 7, 2024
11 checks passed
@JosJuice JosJuice deleted the android-gate-size-crash branch January 7, 2024 18:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants