pub struct Path2D { /* private fields */ }Expand description
A Path2D is a builder for Vec<PathOp>.
§Example
use footile::Path2D;
let path = Path2D::default()
.move_to(10.0, 10.0)
.line_to(90.0, 90.0)
.finish();Implementations§
Source§impl Path2D
impl Path2D
Sourcepub fn relative(self) -> Self
pub fn relative(self) -> Self
Use relative coordinates for subsequent operations.
This is the default setting.
Sourcepub fn move_to(self, x: f32, y: f32) -> Self
pub fn move_to(self, x: f32, y: f32) -> Self
Move the pen to a point.
xX-position of point.yY-position of point.
Sourcepub fn line_to(self, x: f32, y: f32) -> Self
pub fn line_to(self, x: f32, y: f32) -> Self
Add a line from pen to a point.
xX-position of end point.yY-position of end point.
Sourcepub fn quad_to(self, bx: f32, by: f32, cx: f32, cy: f32) -> Self
pub fn quad_to(self, bx: f32, by: f32, cx: f32, cy: f32) -> Self
Add a quadratic bézier spline.
The points are:
- Current pen position: Pa
- Control point: Pb (
bx/by) - Spline end point: Pc (
cx/cy)
Sourcepub fn cubic_to(
self,
bx: f32,
by: f32,
cx: f32,
cy: f32,
dx: f32,
dy: f32,
) -> Self
pub fn cubic_to( self, bx: f32, by: f32, cx: f32, cy: f32, dx: f32, dy: f32, ) -> Self
Add a cubic bézier spline.
The points are:
- Current pen position: Pa
- First control point: Pb (
bx/by) - Second control point: Pc (
cx/cy) - Spline end point: Pd (
dx/dy)
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Path2D
impl RefUnwindSafe for Path2D
impl Send for Path2D
impl Sync for Path2D
impl Unpin for Path2D
impl UnwindSafe for Path2D
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