pub struct Path { /* private fields */ }
Expand description
A Bezier path.
Can be created via PathBuilder
.
Where PathBuilder
can be created from the Path
using clear
to reuse the allocation.
Guarantees
- Has a valid, precomputed bounds.
- All points are finite.
- Has at least two segments.
- Each contour starts with a MoveTo.
- No duplicated Move.
- No duplicated Close.
- Zero-length contours are allowed.
Implementations
sourceimpl Path
impl Path
sourcepub fn bounds(&self) -> Rect
pub fn bounds(&self) -> Rect
Returns the bounds of the path’s points.
The value is already calculated.
sourcepub fn transform(self, ts: Transform) -> Option<Self>
pub fn transform(self, ts: Transform) -> Option<Self>
Returns a transformed in-place path.
Some points may become NaN/inf therefore this method can fail.
sourcepub fn segments(&self) -> PathSegmentsIter<'_>ⓘNotable traits for PathSegmentsIter<'a>impl<'a> Iterator for PathSegmentsIter<'a> type Item = PathSegment;
pub fn segments(&self) -> PathSegmentsIter<'_>ⓘNotable traits for PathSegmentsIter<'a>impl<'a> Iterator for PathSegmentsIter<'a> type Item = PathSegment;
Returns an iterator over path’s segments.
sourcepub fn clear(self) -> PathBuilder
pub fn clear(self) -> PathBuilder
Clears the path and returns a PathBuilder
that will reuse an allocated memory.
Trait Implementations
impl StructuralPartialEq for Path
Auto Trait Implementations
impl RefUnwindSafe for Path
impl Send for Path
impl Sync for Path
impl Unpin for Path
impl UnwindSafe for Path
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more