pub struct VectorIcon(/* private fields */);Expand description
An icon the app draws, as path data in the SVG path syntax (M0 0L10 10Z, arcs too), which SVG files, XAML’s and Avalonia’s geometries and
most icon sets use. A leading F0 (even-odd) or F1 (non-zero), as
XAML’s path data has, sets the fill rule; non-zero by default.
It’s filled in the colour the platform gives symbolic icons: AppKit
draws it as a template image, GTK as a symbolic SVG, Kirigami as a mask,
WinUI as a PathIcon.
Implementations§
Source§impl VectorIcon
impl VectorIcon
Sourcepub fn new(data: &str) -> Result<VectorIcon, String>
pub fn new(data: &str) -> Result<VectorIcon, String>
The path fitted to its own bounds, as XAML’s Path with uniform
stretch shows it.
Sourcepub fn with_view_box(data: &str, view_box: Rect) -> Result<VectorIcon, String>
pub fn with_view_box(data: &str, view_box: Rect) -> Result<VectorIcon, String>
The path in a view box, as an SVG file’s viewBox: icon sets draw
on a grid (24 by 24, say), with room around each shape.
pub fn view_box(&self) -> Rect
Sourcepub fn steps(&self, side: f32) -> Vec<PathStep>
pub fn steps(&self, side: f32) -> Vec<PathStep>
The path in a square of side points, its view box fitted inside,
keeping its proportions, and centred; y goes down.
Trait Implementations§
Source§impl Clone for VectorIcon
impl Clone for VectorIcon
Source§impl Debug for VectorIcon
Its size, not its path: props print in snapshots.
impl Debug for VectorIcon
Its size, not its path: props print in snapshots.