Skip to main content

clamp_resize_within

Function clamp_resize_within 

Source
pub fn clamp_resize_within(
    bbox: Rect,
    mode: ResizeMode,
    delta: Vec2,
    bounds: Rect,
) -> Vec2
Expand description

Clamp a corner-resize delta so resize_rect(bbox, mode, delta) keeps the dragged corner within bounds (the fixed corner is assumed already inside), so a resized icon can’t grow past its block.