Function draw_shadow
pub fn draw_shadow(
canvas: &Canvas,
path: &Handle<SkPath>,
z_plane_params: impl Into<Point3>,
light_pos: impl Into<Point3>,
light_radius: f32,
ambient_color: impl Into<Color>,
spot_color: impl Into<Color>,
flags: impl Into<Option<ShadowFlags>>,
)Expand description
Draw an offset spot shadow and outlining ambient shadow for the given path using a disc light. The shadow may be cached, depending on the path type and canvas matrix. If the matrix is perspective or the path is volatile, it will not be cached.
canvasThe canvas on which to draw the shadows.pathThe occluder used to generate the shadows.z_plane_paramsValues for the plane function which returns the Z offset of the occluder from the canvas based on local x and y values (the current matrix is not applied).light_posGenerally, the 3D position of the light relative to the canvas plane. Ifself::ShadowFlags::DIRECTIONAL_LIGHTis set, this specifies a vector pointing towards the light.light_radiusGenerally, the radius of the disc light. Ifself::ShadowFlags::DIRECTIONAL_LIGHTis set, this specifies the amount of blur when the occluder is at Z offset == 1. The blur will grow linearly as the Z value increases.ambient_colorThe color of the ambient shadow.spot_colorThe color of the spot shadow.flagsOptions controlling opaque occluder optimizations, shadow appearance, and light position. Seeself::ShadowFlags.