Skip to main content

clamp_to_min_width

Function clamp_to_min_width 

Source
fn clamp_to_min_width(
    mode: ResizeMode,
    orig: Rect,
    min_width: f32,
    delta: Vec2,
) -> Vec2
Expand description

Clamp the x-component of a resize delta so the block cannot shrink below min_width. Which edge moves (and therefore the sign of the constraint) depends on the resize mode.