Skip to main content

clamp_radii

Function clamp_radii 

Source
pub fn clamp_radii(radii: [(f32, f32); 4], w: f32, h: f32) -> [(f32, f32); 4]
Expand description

Scale a set of corner radii (rx, ry) (CSS order TL, TR, BR, BL) down proportionally so no opposing pair exceeds the box dimensions, following the CSS border-radius clamping rule.