Skip to main content

draw_icon_layered

Function draw_icon_layered 

pub fn draw_icon_layered(
    scene: &mut Scene,
    transform: Affine,
    rect: Rect,
    icon: Icon,
    stroke_px: f64,
    color_for: impl FnMut(usize) -> AlphaColor<Srgb>,
)
Expand description

draw_icon with a per-subpath colour. Exists for glyphs whose subpaths mean different things — the Wi-Fi arcs are a scale, not a picture, so a two-bar signal should paint two arcs lit and two dim rather than the whole glyph at one alpha (drawing four nested icons at four sizes would not line up; they must come from one path table).

color_for receives the subpath index in the order icon_subpaths returns them (for Icon::Wifi: base dot, outer arc, middle arc, inner arc).