pub struct VectorPath { /* private fields */ }Expand description
A parsed SVG path: subpaths flattened to polylines, ready to fill.
Implementations§
Source§impl VectorPath
impl VectorPath
Sourcepub fn parse(d: &str) -> Result<Self, SvgPathError>
pub fn parse(d: &str) -> Result<Self, SvgPathError>
Parses SVG path data (the d attribute syntax).
Sourcepub fn parse_with_fill_rule(
d: &str,
fill_rule: PathFillRule,
) -> Result<Self, SvgPathError>
pub fn parse_with_fill_rule( d: &str, fill_rule: PathFillRule, ) -> Result<Self, SvgPathError>
Parses SVG path data with an explicit fill rule.
Sourcepub fn with_fill_rule(self, fill_rule: PathFillRule) -> Self
pub fn with_fill_rule(self, fill_rule: PathFillRule) -> Self
Returns a copy using the given fill rule.
Sourcepub fn scaled(&self, factor: f32) -> Self
pub fn scaled(&self, factor: f32) -> Self
Returns a uniformly scaled copy (icon path data drawn at a target
size: parse(d)?.scaled(size / view_box)).
Sourcepub fn translated(&self, dx: f32, dy: f32) -> Self
pub fn translated(&self, dx: f32, dy: f32) -> Self
A copy of this path translated by (dx, dy).
Sourcepub fn fill_rule(&self) -> PathFillRule
pub fn fill_rule(&self) -> PathFillRule
The fill rule used by coverage_mask.
Trait Implementations§
Source§impl Clone for VectorPath
impl Clone for VectorPath
Source§fn clone(&self) -> VectorPath
fn clone(&self) -> VectorPath
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for VectorPath
impl RefUnwindSafe for VectorPath
impl Send for VectorPath
impl Sync for VectorPath
impl Unpin for VectorPath
impl UnsafeUnpin for VectorPath
impl UnwindSafe for VectorPath
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more