Skip to main content

shadow

Function shadow 

pub fn shadow(
    scene: &mut Scene,
    transform: Affine,
    rect: Rect,
    radius: f64,
    token: &Shadow,
)
Expand description

Paint the drop shadow an elevation token describes, following rect’s own corner radius — a true Gaussian blur of the surface’s own rounded outline, unlike soft_shadow’s square-corner-SDF approximation.

The token’s color alpha is the shadow’s strength and is honoured here; soft_shadow ignores it in favour of a separate intensity argument. No-op for a degenerate rect or a token with no blur.