[−][src]Struct footile::PathBuilder
Builder for Path2D.
Example
use footile::PathBuilder; let path = PathBuilder::default() .move_to(10.0, 10.0) .line_to(90.0, 90.0) .build();
Implementations
impl PathBuilder
[src]
pub fn absolute(self) -> Self
[src]
Use absolute coordinates for subsequent operations.
pub fn relative(self) -> Self
[src]
Use relative coordinates for subsequent operations.
This is the default setting.
pub fn close(self) -> Self
[src]
Close current sub-path and move pen to origin.
pub fn move_to(self, x: f32, y: f32) -> Self
[src]
Move the pen to a point.
x
X-position of point.y
Y-position of point.
pub fn line_to(self, x: f32, y: f32) -> Self
[src]
Add a line from pen to a point.
x
X-position of end point.y
Y-position of end point.
pub fn quad_to(self, bx: f32, by: f32, cx: f32, cy: f32) -> Self
[src]
Add a quadratic bézier spline.
The points are:
- Current pen position: Pa
- Control point: Pb (
bx
/by
) - Spline end point: Pc (
cx
/cy
)
pub fn cubic_to(
self,
bx: f32,
by: f32,
cx: f32,
cy: f32,
dx: f32,
dy: f32
) -> Self
[src]
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
)
pub fn pen_width(self, width: f32) -> Self
[src]
Set pen stroke width.
All subsequent path points will be affected, until the stroke width is changed again.
width
Pen stroke width.
pub fn build(self) -> Path2D
[src]
Build path from specified operations.
Trait Implementations
impl Default for PathBuilder
[src]
fn default() -> PathBuilder
[src]
Create a new PathBuilder.
Auto Trait Implementations
impl RefUnwindSafe for PathBuilder
impl Send for PathBuilder
impl Sync for PathBuilder
impl Unpin for PathBuilder
impl UnwindSafe for PathBuilder
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,