Enum svgdom::PathSegment
[−]
[src]
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: bool | |
x: f64 | |
y: f64 |
LineTo
Fields of LineTo
abs: bool | |
x: f64 | |
y: f64 |
HorizontalLineTo
Fields of HorizontalLineTo
abs: bool | |
x: f64 |
VerticalLineTo
Fields of VerticalLineTo
abs: bool | |
y: f64 |
CurveTo
Fields of CurveTo
abs: bool | |
x1: f64 | |
y1: f64 | |
x2: f64 | |
y2: f64 | |
x: f64 | |
y: f64 |
SmoothCurveTo
Fields of SmoothCurveTo
abs: bool | |
x2: f64 | |
y2: f64 | |
x: f64 | |
y: f64 |
Quadratic
Fields of Quadratic
abs: bool | |
x1: f64 | |
y1: f64 | |
x: f64 | |
y: f64 |
SmoothQuadratic
Fields of SmoothQuadratic
abs: bool | |
x: f64 | |
y: f64 |
EllipticalArc
Fields of EllipticalArc
abs: bool | |
rx: f64 | |
ry: f64 | |
x_axis_rotation: f64 | |
large_arc: bool | |
sweep: bool | |
x: f64 | |
y: 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 FuzzyEq<PathSegment> for PathSegment
[src]
fn fuzzy_eq(&self, other: &PathSegment) -> bool
[src]
Returns true
if values are approximately equal.
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]
fn eq(&self, __arg_0: &PathSegment) -> bool
[src]
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, __arg_0: &PathSegment) -> bool
[src]
This method tests for !=
.
impl Clone for PathSegment
[src]
fn clone(&self) -> PathSegment
[src]
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
Performs copy-assignment from source
. Read more