Skip to main content

trim_groups

Function trim_groups 

pub fn trim_groups<T>(
    groups: Vec<KindGroup<T>>,
    row_budget: usize,
    expanded: &[ResourceKind],
) -> Vec<KindGroup<T>>
Expand description

Keep each group to a fair share of row_budget rows, round-robin from the front, except the kinds in expanded, which keep every row. A group that lost rows keeps its total, so its header and its show_all_entry can say how many there are. A lone group, or a zero budget, keeps everything.

The row offering a cut group’s rest is drawn in the same list as the rows, so row_budget is what stays for rows once those rows are paid for: cutting to the whole budget would push the last group’s rows — and the row that offers them — off the card.