settings: name the toolkit in the slider comments

The in-repo comment rule allows a comment only when it names an external
system, version or issue, so both of these now name Compose Material 3,
which is what they are actually about.
This commit is contained in:
austinried
2026-10-16 13:07:12 +00:00
parent d245da20a4
commit 5b6c0ef45c
2 changed files with 5 additions and 5 deletions
@@ -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(
@@ -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),
)