Skip to content

Commit

Permalink
fix: position precision slider movement
Browse files Browse the repository at this point in the history
  • Loading branch information
andrekir committed Aug 27, 2024
1 parent 3cdbb86 commit a508f85
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ import com.geeksville.mesh.util.DistanceUnit
import com.geeksville.mesh.util.toDistanceString
import java.util.Locale
import kotlin.math.pow
import kotlin.math.roundToInt

private const val PositionEnabled = 32
private const val PositionDisabled = 0
Expand Down Expand Up @@ -68,7 +69,7 @@ fun PositionPrecisionPreference(
) {
Slider(
value = value.toFloat(),
onValueChange = { onValueChanged(it.toInt()) },
onValueChange = { onValueChanged(it.roundToInt()) },
enabled = enabled,
valueRange = PositionPrecisionMin.toFloat()..PositionPrecisionMax.toFloat(),
steps = PositionPrecisionMax - PositionPrecisionMin - 1,
Expand Down

0 comments on commit a508f85

Please sign in to comment.