pub fn split_h_n<const N: usize>(
area: Rect,
constraints: [Constraint; N],
) -> [Rect; N]Expand description
Split area into columns left-to-right, like split_h, but sized to a compile-time pane
count N: takes [Constraint; N] and returns [Rect; N] instead of allocating a Vec.
See split_v_n for why the array-sized signature is worth it over indexing a Vec. Never
allocates, for any N; never panics, for the same reason as split_h.
ยงExamples
use retroglyph_core::grid::Rect;
use retroglyph_ui::{Constraint, split_h_n};
let area = Rect::new(0, 0, 100, 5);
let [left, right] = split_h_n(area, [Constraint::Percent(30), Constraint::Fill(1)]);
assert_eq!((left.width(), right.width()), (30, 70));