Skip to main content

fit

Function fit 

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

Lays sections out in room points, keeping empty points of it under the last section.

Heights set by hand are kept and the others (the last open section among them) share the rest equally, each at least its least height. In a panel too short for that, the sections sized by the list are already at their least, so those set by hand give way, from the bottom up. When even the least heights do not fit, each has its least and Fit::overflow says by how much the stack is too tall. The empty room gives way after the sections sized by the list and before those set by hand; it comes back with the room, as they do.