Skip to main content

rail_width_fitting

Function rail_width_fitting 

pub fn rail_width_fitting<'a>(
    theme: &Theme,
    text_renderer: &mut TextRenderer,
    labels: impl IntoIterator<Item = &'a str>,
) -> f64
Expand description

How wide a rail of these destination labels is: its stock width, grown with the text so its longest single word fits whole, but never past the stock width times the text’s growth nor metrics.rail_max_width. A fragment such as “Cha…” names nothing, so the rail widens before any word is shortened; only past that cap does a word elide.