pub struct Path {
pub elements: Vec<PathEl>,
}Expand description
A vector path composed of a sequence of PathEl elements.
Paths are the primary geometric primitive passed to renderers. Use the
builder methods (move_to, line_to,
etc.) to construct paths incrementally, or the convenience constructors
Path::rect and Path::circle for common shapes.
Fields§
§elements: Vec<PathEl>The ordered sequence of path elements.
Implementations§
Source§impl Path
impl Path
Sourcepub fn line_to(&mut self, x: f64, y: f64) -> &mut Self
pub fn line_to(&mut self, x: f64, y: f64) -> &mut Self
Appends a straight line from the current point to (x, y).
Sourcepub fn quad_to(&mut self, x1: f64, y1: f64, x: f64, y: f64) -> &mut Self
pub fn quad_to(&mut self, x1: f64, y1: f64, x: f64, y: f64) -> &mut Self
Appends a quadratic Bezier curve through control point (x1, y1) to
endpoint (x, y).
Sourcepub fn curve_to(
&mut self,
x1: f64,
y1: f64,
x2: f64,
y2: f64,
x: f64,
y: f64,
) -> &mut Self
pub fn curve_to( &mut self, x1: f64, y1: f64, x2: f64, y2: f64, x: f64, y: f64, ) -> &mut Self
Appends a cubic Bezier curve through control points (x1, y1) and
(x2, y2) to endpoint (x, y).
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Path
impl RefUnwindSafe for Path
impl Send for Path
impl Sync for Path
impl Unpin for Path
impl UnsafeUnpin for Path
impl UnwindSafe for Path
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
Mutably borrows from an owned value. Read more