Skip to main content

fit_within

Function fit_within 

pub fn fit_within(
    asked: &[Asked],
    most: &[f32],
    room: f32,
    empty: f32,
) -> (Fit, f32)
Expand description

fit with bounds: a section sized by the list, the last open one included, is never laid out taller than most (its greatest height or its content’s; missing or infinite, no bound) nor shorter than its least. The others share what is left in turn, and the room none takes goes under the last band. Heights set by hand are kept as by fit: the last open section ignores its own.

Returns the fit, its Fit::empty holding that room too, and the room left by the bounds alone (not kept in a layout: it changes with the content).