Fix crash on slider

pull/240/head
Koitharu 4 years ago
parent 627a00beb4
commit 65dbc6b8e5
No known key found for this signature in database
GPG Key ID: 8E861F8CE6E7CE27

@ -127,7 +127,8 @@ fun <T> RecyclerView.ViewHolder.getItem(clazz: Class<T>): T? {
fun Slider.setValueRounded(newValue: Float) { fun Slider.setValueRounded(newValue: Float) {
val step = stepSize val step = stepSize
value = (newValue / step).roundToInt() * step val roundedValue = (newValue / step).roundToInt() * step
value = roundedValue.coerceIn(valueFrom, valueTo)
} }
val RecyclerView.isScrolledToTop: Boolean val RecyclerView.isScrolledToTop: Boolean

Loading…
Cancel
Save