Struct fonterator::PathBuilder
source · pub struct PathBuilder { /* private fields */ }
Expand description
Implementations
sourceimpl PathBuilder
impl PathBuilder
sourcepub fn new() -> PathBuilder
pub fn new() -> PathBuilder
Create a new PathBuilder.
sourcepub fn absolute(self) -> PathBuilder
pub fn absolute(self) -> PathBuilder
Use absolute coordinates for subsequent operations.
sourcepub fn relative(self) -> PathBuilder
pub fn relative(self) -> PathBuilder
Use relative coordinates for subsequent operations.
This is the default setting.
sourcepub fn close(self) -> PathBuilder
pub fn close(self) -> PathBuilder
Close current sub-path and move pen to origin.
sourcepub fn move_to(self, bx: f32, by: f32) -> PathBuilder
pub fn move_to(self, bx: f32, by: f32) -> PathBuilder
Move pen to a point.
bx
X-position of point.by
Y-position of point.
sourcepub fn line_to(self, bx: f32, by: f32) -> PathBuilder
pub fn line_to(self, bx: f32, by: f32) -> PathBuilder
Add a line from pen to a point.
bx
X-position of end point.by
Y-position of end point.
sourcepub fn quad_to(self, bx: f32, by: f32, cx: f32, cy: f32) -> PathBuilder
pub fn quad_to(self, bx: f32, by: f32, cx: f32, cy: f32) -> PathBuilder
Add a quadratic bézier spline.
The points are A (current pen position), B (control point), and C (spline end point).
bx
X-position of control point.by
Y-position of control point.cx
X-position of end point.cy
Y-position of end point.
sourcepub fn cubic_to(
self,
bx: f32,
by: f32,
cx: f32,
cy: f32,
dx: f32,
dy: f32
) -> PathBuilder
pub fn cubic_to(
self,
bx: f32,
by: f32,
cx: f32,
cy: f32,
dx: f32,
dy: f32
) -> PathBuilder
Add a cubic bézier spline.
The points are A (current pen position), B (first control point), C (second control point) and D (spline end point).
bx
X-position of first control point.by
Y-position of first control point.cx
X-position of second control point.cy
Y-position of second control point.dx
X-position of end point.dy
Y-position of end point.
sourcepub fn pen_width(self, width: f32) -> PathBuilder
pub fn pen_width(self, width: f32) -> PathBuilder
Set pen stroke width.
All subsequent path points will be affected, until the stroke width is changed again.
width
Pen stroke width.
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
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
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