pub fn centered_rect(screen: Rect, width: u16, height: u16) -> RectExpand description
Compute a width×height Rect centered within screen.
width/height are clamped down to screen’s own dimensions if larger,
so the result never extends past screen’s edges – a modal, dialog, or
tooltip box built from this is always fully on-screen, even on a
terminal too small to fit the box’s requested size. Pure layout math: no
drawing, no Terminal. Pairs with panel/modal in retroglyph-widgets
(the draw module) for a centered, bordered box.