Skip to main content

step_index

Function step_index 

Source
pub fn step_index(count: usize, raw: f32) -> usize
Expand description

The list position a slider’s raw value means: the nearest one, never past either end.

iced’s step already rounds, but a drag can deliver the range’s own end as a float that is not quite an integer, and a value from outside the range must not index past the list. NaN is the first position, because it is the only answer that is always valid.