Skip to main content

chip_rect

Function chip_rect 

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

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