Enum svgtypes::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
MoveToFields of MoveTo
abs: bool | |
x: f64 | |
y: f64 |
LineToFields of LineTo
abs: bool | |
x: f64 | |
y: f64 |
HorizontalLineToFields of HorizontalLineTo
abs: bool | |
x: f64 |
VerticalLineToFields of VerticalLineTo
abs: bool | |
y: f64 |
CurveToFields of CurveTo
abs: bool | |
x1: f64 | |
y1: f64 | |
x2: f64 | |
y2: f64 | |
x: f64 | |
y: f64 |
SmoothCurveToFields of SmoothCurveTo
abs: bool | |
x2: f64 | |
y2: f64 | |
x: f64 | |
y: f64 |
QuadraticFields of Quadratic
abs: bool | |
x1: f64 | |
y1: f64 | |
x: f64 | |
y: f64 |
SmoothQuadraticFields of SmoothQuadratic
abs: bool | |
x: f64 | |
y: f64 |
EllipticalArcFields of EllipticalArc
abs: bool | |
rx: f64 | |
ry: f64 | |
x_axis_rotation: f64 | |
large_arc: bool | |
sweep: bool | |
x: f64 | |
y: f64 |
ClosePathFields 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 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
impl Copy for PathSegment[src]
impl PartialEq 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 Debug for PathSegment[src]
fn fmt(&self, __arg_0: &mut Formatter) -> Result[src]
Formats the value using the given formatter. Read more