Enum svgdom::PathSegment

source ·
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,
    },
}
Expand description

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

abs: bool
x: f64
y: f64

LineTo

Fields

abs: bool
x: f64
y: f64

HorizontalLineTo

Fields

abs: bool
x: f64

VerticalLineTo

Fields

abs: bool
y: f64

CurveTo

Fields

abs: bool
x1: f64
y1: f64
x2: f64
y2: f64
x: f64
y: f64

SmoothCurveTo

Fields

abs: bool
x2: f64
y2: f64
x: f64
y: f64

Quadratic

Fields

abs: bool
x1: f64
y1: f64
x: f64
y: f64

SmoothQuadratic

Fields

abs: bool
x: f64
y: f64

EllipticalArc

Fields

abs: bool
rx: f64
ry: f64
x_axis_rotation: f64
large_arc: bool
sweep: bool
x: f64
y: f64

ClosePath

Fields

abs: bool

Implementations

Sets the segment absolute value.

Returns a segment type.

Returns true if the segment is absolute.

Returns true if the segment is relative.

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

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

Trait Implementations

Returns a copy of the value. Read more
Performs copy-assignment from source. Read more
Formats the value using the given formatter. Read more
Returns true if values are approximately equal.
Returns true if values are not approximately equal.
This method tests for self and other values to be equal, and is used by ==. Read more
This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The resulting type after obtaining ownership.
Creates owned data from borrowed data, usually by cloning. Read more
Uses borrowed data to replace owned data, usually by cloning. Read more
The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.