diff --git a/app/src/main/kotlin/com/subtracks/ui/settings/ReplayGainControls.kt b/app/src/main/kotlin/com/subtracks/ui/settings/ReplayGainControls.kt index 534ae664..fe43209d 100644 --- a/app/src/main/kotlin/com/subtracks/ui/settings/ReplayGainControls.kt +++ b/app/src/main/kotlin/com/subtracks/ui/settings/ReplayGainControls.kt @@ -12,9 +12,9 @@ internal const val REPLAY_GAIN_PREAMP_STEP_DB = 0.5f internal val REPLAY_GAIN_PREAMP_STEPS = ((MAX_REPLAY_GAIN_PREAMP_DB - MIN_REPLAY_GAIN_PREAMP_DB) / REPLAY_GAIN_PREAMP_STEP_DB).toInt() - 1 -// Material's slider snaps in pixel space and converts back, so the value it reports is near, but not -// on, the grid it was configured with (for example -0.99999905 for -1.0). Snap before showing or -// storing it. +// Compose Material 3's Slider snaps in pixel space and converts back, so the value it reports is +// near, but not on, the grid it was configured with (for example -0.99999905 for -1.0). Snap before +// showing or storing it. internal fun snapReplayGainPreampDb(value: Float): Float = (value / REPLAY_GAIN_PREAMP_STEP_DB).roundToInt() * REPLAY_GAIN_PREAMP_STEP_DB internal fun stepReplayGainPreampDb( diff --git a/app/src/main/kotlin/com/subtracks/ui/settings/SettingsScreen.kt b/app/src/main/kotlin/com/subtracks/ui/settings/SettingsScreen.kt index 42618864..131f5be2 100644 --- a/app/src/main/kotlin/com/subtracks/ui/settings/SettingsScreen.kt +++ b/app/src/main/kotlin/com/subtracks/ui/settings/SettingsScreen.kt @@ -799,8 +799,8 @@ private fun ReplayGainPreampDialog( onValueChange = { draft = snapReplayGainPreampDb(it) }, valueRange = MIN_REPLAY_GAIN_PREAMP_DB..MAX_REPLAY_GAIN_PREAMP_DB, steps = REPLAY_GAIN_PREAMP_STEPS, - // 59 steps is a tick every few dps, which reads as a smudge; the snapping is - // what matters, so the ticks are not drawn. + // Compose Material 3 draws one track tick per step, and at 59 steps they + // smear together, so the ticks are suppressed and the snapping kept. track = { state -> SliderDefaults.Track(sliderState = state, drawTick = { _, _ -> }) }, modifier = Modifier.weight(1f), )