Skip to main content

in_rounded_rect

Function in_rounded_rect 

Source
pub fn in_rounded_rect(p: Vec2, w: f32, h: f32, radii: [f32; 4]) -> bool
Expand description

Whether p (relative to the box’s top-left) is inside a w×h box with the given corner radii: in the box, and not in a corner’s square past its arc. Radii are clamped to the half extents as the shader clamps them, so an oversized radius is the pill it draws as.