pub struct BezierPath { /* private fields */ }Expand description
A mixed straight/cubic Bézier path with dash-point metadata on its vertices.
vertex_is_dash_point contains one entry for the initial vertex followed
by one entry for every segment end, so its length is always
geometry.num_segments() + 1. For a closed path, its first and final
entries describe the same seam vertex and therefore have the same value.
Implementations§
Source§impl BezierPath
impl BezierPath
Sourcepub fn geometry(&self) -> &BezierString
pub fn geometry(&self) -> &BezierString
Get the mixed straight/cubic geometry.
Sourcepub fn vertex_is_dash_point(&self) -> &[bool]
pub fn vertex_is_dash_point(&self) -> &[bool]
Get the dash-point state of the initial vertex and every segment end.
Sourcepub fn map_coords(self, transform: impl Fn(Coord) -> Coord) -> Self
pub fn map_coords(self, transform: impl Fn(Coord) -> Coord) -> Self
Transform every endpoint and Bézier handle while preserving path topology and dash-point metadata.
transform should map equal coordinates to equal coordinates, as
coordinate reprojection functions normally do.
Sourcepub fn into_parts(self) -> (BezierString, Vec<bool>)
pub fn into_parts(self) -> (BezierString, Vec<bool>)
Consume the path and return its geometry and vertex dash flags.
Sourcepub fn segments(&self) -> impl ExactSizeIterator<Item = (&BezierSegment, bool)>
pub fn segments(&self) -> impl ExactSizeIterator<Item = (&BezierSegment, bool)>
Iterate over segments paired with the dash-point state of their end vertices.
The initial vertex’s state is available as
vertex_is_dash_point().first().
Trait Implementations§
Source§impl Clone for BezierPath
impl Clone for BezierPath
Source§fn clone(&self) -> BezierPath
fn clone(&self) -> BezierPath
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreAuto Trait Implementations§
impl Freeze for BezierPath
impl RefUnwindSafe for BezierPath
impl Send for BezierPath
impl Sync for BezierPath
impl Unpin for BezierPath
impl UnsafeUnpin for BezierPath
impl UnwindSafe for BezierPath
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more