Skip to main content

box_shadow

Function box_shadow 

Source
pub fn box_shadow(
    fb: &mut Framebuffer,
    rect: (f32, f32, f32, f32),
    offset_x: f32,
    offset_y: f32,
    blur_radius: f32,
    color: Color,
    cache: &mut GaussianCache,
)
Expand description

Render a drop (or inset) box shadow for a rectangle rect into fb.

§Parameters

  • rect — the widget’s bounding rectangle (x, y, w, h).
  • offset_x, offset_y — shadow offset in pixels.
  • blur_radius — shadow blur radius in pixels.
  • color — shadow colour (alpha is composited).
  • cache — Gaussian kernel cache (avoids recomputation).

The shadow is rendered behind the widget: callers should draw the widget content over the shadow after this call.