pub enum PathEl {
MoveTo(Point),
LineTo(Point),
QuadTo(Point, Point),
CurveTo(Point, Point, Point),
ClosePath,
}Expand description
The element of a Bézier path.
A valid path has MoveTo at the beginning of each subpath.
Variants§
MoveTo(Point)
Move directly to the point without drawing anything, starting a new subpath.
LineTo(Point)
Draw a line from the current location to the point.
QuadTo(Point, Point)
Draw a quadratic Bézier using the current location and the two points.
The first point is the Bézier’s control point, the second is its end point.
CurveTo(Point, Point, Point)
Draw a cubic Bézier using the current location and the three points.
The first two points are the Bézier’s control points, the last point is its end point.
ClosePath
Close off the path.
Implementations§
Trait Implementations§
Source§impl<'de> Deserialize<'de> for PathEl
impl<'de> Deserialize<'de> for PathEl
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl Extend<PathEl> for BezPath
impl Extend<PathEl> for BezPath
Source§fn extend<I: IntoIterator<Item = PathEl>>(&mut self, iter: I)
fn extend<I: IntoIterator<Item = PathEl>>(&mut self, iter: I)
Add the items from the iterator to this path.
Note that if you’re attempting to make a continuous path, you will generally
want to ensure that the iterator does not contain any MoveTo
or ClosePath elements.
Note especially that many (open) shapes will start with a MoveTo if
you use their path_elements function.
Some shapes have alternatives for this use case, such as Arc::append_iter.
Source§fn extend_one(&mut self, item: A)
fn extend_one(&mut self, item: A)
extend_one)Source§fn extend_reserve(&mut self, additional: usize)
fn extend_reserve(&mut self, additional: usize)
extend_one)