[][src]Enum svgdom::PathSegment

pub enum PathSegment {
    MoveTo {
        abs: bool,
        x: f64,
        y: f64,
    },
    LineTo {
        abs: bool,
        x: f64,
        y: f64,
    },
    HorizontalLineTo {
        abs: bool,
        x: f64,
    },
    VerticalLineTo {
        abs: bool,
        y: f64,
    },
    CurveTo {
        abs: bool,
        x1: f64,
        y1: f64,
        x2: f64,
        y2: f64,
        x: f64,
        y: f64,
    },
    SmoothCurveTo {
        abs: bool,
        x2: f64,
        y2: f64,
        x: f64,
        y: f64,
    },
    Quadratic {
        abs: bool,
        x1: f64,
        y1: f64,
        x: f64,
        y: f64,
    },
    SmoothQuadratic {
        abs: bool,
        x: f64,
        y: f64,
    },
    EllipticalArc {
        abs: bool,
        rx: f64,
        ry: f64,
        x_axis_rotation: f64,
        large_arc: bool,
        sweep: bool,
        x: f64,
        y: f64,
    },
    ClosePath {
        abs: bool,
    },
}

Representation of the path segment.

If you want to change the segment type (for example MoveTo to LineTo) you should create a new segment. But you still can change points or make segment relative or absolute.

Variants

MoveTo

Fields of MoveTo

abs: boolx: f64y: f64
LineTo

Fields of LineTo

abs: boolx: f64y: f64
HorizontalLineTo

Fields of HorizontalLineTo

abs: boolx: f64
VerticalLineTo

Fields of VerticalLineTo

abs: booly: f64
CurveTo

Fields of CurveTo

abs: boolx1: f64y1: f64x2: f64y2: f64x: f64y: f64
SmoothCurveTo

Fields of SmoothCurveTo

abs: boolx2: f64y2: f64x: f64y: f64
Quadratic

Fields of Quadratic

abs: boolx1: f64y1: f64x: f64y: f64
SmoothQuadratic

Fields of SmoothQuadratic

abs: boolx: f64y: f64
EllipticalArc

Fields of EllipticalArc

abs: boolrx: f64ry: f64x_axis_rotation: f64large_arc: boolsweep: boolx: f64y: f64
ClosePath

Fields of ClosePath

abs: bool

Methods

impl PathSegment[src]

pub fn set_absolute(&mut self, new_abs: bool)[src]

Sets the segment absolute value.

pub fn cmd(&self) -> PathCommand[src]

Returns a segment type.

pub fn is_absolute(&self) -> bool[src]

Returns true if the segment is absolute.

pub fn is_relative(&self) -> bool[src]

Returns true if the segment is relative.

pub fn x(&self) -> Option<f64>[src]

Returns the x coordinate of the segment if it has one.

pub fn y(&self) -> Option<f64>[src]

Returns the y coordinate of the segment if it has one.

Trait Implementations

impl Debug for PathSegment[src]

impl Clone for PathSegment[src]

fn clone_from(&mut self, source: &Self)1.0.0[src]

Performs copy-assignment from source. Read more

impl FuzzyEq<PathSegment> for PathSegment[src]

fn fuzzy_ne(&self, other: &Rhs) -> bool[src]

Returns true if values are not approximately equal.

impl Copy for PathSegment[src]

impl PartialEq<PathSegment> for PathSegment[src]

Auto Trait Implementations

Blanket Implementations

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]