Skip to main content

snap_resize_aspect

Function snap_resize_aspect 

Source
pub fn snap_resize_aspect(
    bbox: Rect,
    mode: ResizeMode,
    resized: Rect,
    aspect: f32,
    radius: f32,
) -> Option<Rect>
Expand description

If the corner-mode box resized (grown from bbox) is within radius of the image’s intrinsic aspect (intrinsic_w / intrinsic_h), return the box snapped so w/h == aspect exactly — the dragged corner projected onto the aspect diagonal from the fixed corner; else None. Every point on that diagonal has w/h == aspect by construction.