Skip to main content

bar_geometry

Function bar_geometry 

Source
fn bar_geometry(index: usize, count: usize) -> (f64, f64)
Expand description

The horizontal (left%, width%) of bucket index of count, tiling the lane edge-to-edge (bar i spans [i/count, (i+1)/count]). Computing the width as the gap to the next bucket avoids cumulative rounding and lands the final bar exactly at 100%. Pure — the regression guard for the “bars render blank because they have no width” bug.