Skip to main content

clamp

Function clamp 

Source
pub fn clamp(rect: Rect, region: Rect) -> Rect
Expand description

rect moved — never resized — until it lies inside region. A rect too big for the region aligns to the region’s top left, so what overflows is the far edge rather than the near one.