Struct footile::PathBuilder

source ·
pub struct PathBuilder { /* private fields */ }
Expand description

Builder for Path2D.

Example

use footile::PathBuilder;
let path = PathBuilder::new()
                       .move_to(10.0, 10.0)
                       .line_to(90.0, 90.0)
                       .build();

Implementations

Create a new PathBuilder.

Use absolute coordinates for subsequent operations.

Use relative coordinates for subsequent operations.

This is the default setting.

Close current sub-path and move pen to origin.

Move pen to a point.

  • bx X-position of point.
  • by Y-position of point.

Add a line from pen to a point.

  • bx X-position of end point.
  • by Y-position of end point.

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.

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.

Set pen stroke width.

All subsequent path points will be affected, until the stroke width is changed again.

  • width Pen stroke width.

Build path from specified operations.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.