Skip to main content

chip_rect

Function chip_rect 

pub fn chip_rect(anchor: Rect, size: (f64, f64), viewport: Rect) -> Rect
Expand description

Preferred placement is centred just below the anchor; flips above if that would spill past the bottom edge, and clamps to the bottom edge if neither side has room. Clamped horizontally too, so a control at the far edge gets a chip that hugs it instead of painting off-screen.