Skip to main content

sdf_stroked_rounded_rect

Function sdf_stroked_rounded_rect 

Source
pub fn sdf_stroked_rounded_rect(
    p: Point,
    half_size: (f32, f32),
    radii: [f32; 4],
    half_width: f32,
    join: StrokeJoin,
) -> f32
Expand description

Signed distance to the outline of a rounded box stroked with a centered stroke of width 2 * half_width.

half_size is the inflated box (geometry plus half_width on every side), matching what the renderer hands the shader.