mirror of
https://github.com/tachiyomiorg/tachiyomi.git
synced 2024-12-22 06:51:51 +01:00
ChapterNavigator: Fix rounding error when changing page with slider (#9477)
ChapterNavigator: Fix rounding error when changing page from slider
This commit is contained in:
parent
71f6e07e71
commit
84acae27b7
@ -35,6 +35,7 @@ import androidx.compose.ui.unit.LayoutDirection
|
|||||||
import androidx.compose.ui.unit.dp
|
import androidx.compose.ui.unit.dp
|
||||||
import eu.kanade.presentation.util.isTabletUi
|
import eu.kanade.presentation.util.isTabletUi
|
||||||
import eu.kanade.tachiyomi.R
|
import eu.kanade.tachiyomi.R
|
||||||
|
import kotlin.math.roundToInt
|
||||||
|
|
||||||
@Composable
|
@Composable
|
||||||
fun ChapterNavigator(
|
fun ChapterNavigator(
|
||||||
@ -106,7 +107,7 @@ fun ChapterNavigator(
|
|||||||
valueRange = 1f..totalPages.toFloat(),
|
valueRange = 1f..totalPages.toFloat(),
|
||||||
steps = totalPages - 2,
|
steps = totalPages - 2,
|
||||||
onValueChange = {
|
onValueChange = {
|
||||||
onSliderValueChange(it.toInt() - 1)
|
onSliderValueChange(it.roundToInt() - 1)
|
||||||
},
|
},
|
||||||
interactionSource = interactionSource,
|
interactionSource = interactionSource,
|
||||||
)
|
)
|
||||||
|
Loading…
Reference in New Issue
Block a user