mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-01-31 00:32:53 +00:00
Merge pull request #12375 from JosJuice/android-gate-size-crash
Android: Fix crash when trying to edit gate size setting
This commit is contained in:
commit
4e57b66dcf
@ -56,9 +56,6 @@ open class FloatSliderSetting : SliderSetting {
|
||||
get() = floatSetting.float
|
||||
|
||||
open fun setSelectedValue(settings: Settings, selection: Float) {
|
||||
floatSetting.setFloat(
|
||||
settings,
|
||||
BigDecimal((selection).toDouble()).round(MathContext(3)).toFloat()
|
||||
)
|
||||
floatSetting.setFloat(settings, selection)
|
||||
}
|
||||
}
|
||||
|
@ -41,6 +41,7 @@ import java.io.File
|
||||
import java.io.IOException
|
||||
import java.io.RandomAccessFile
|
||||
import java.util.*
|
||||
import kotlin.math.roundToInt
|
||||
|
||||
class SettingsAdapter(
|
||||
private val fragmentView: SettingsFragmentView,
|
||||
@ -259,7 +260,7 @@ class SettingsAdapter(
|
||||
slider.stepSize = item.stepSize.toFloat()
|
||||
}
|
||||
}
|
||||
slider.value = seekbarProgress
|
||||
slider.value = (seekbarProgress / slider.stepSize).roundToInt() * slider.stepSize
|
||||
slider.addOnChangeListener(this)
|
||||
|
||||
dialog = MaterialAlertDialogBuilder(fragmentView.fragmentActivity)
|
||||
|
Loading…
x
Reference in New Issue
Block a user