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

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 the pen to a point.

  • x X-position of point.
  • y Y-position of point.

Add a line from pen to a point.

  • x X-position of end point.
  • y Y-position of end point.

Add a quadratic bézier spline.

The points are:

  • Current pen position: Pa
  • Control point: Pb (bx / by)
  • Spline end point: Pc (cx / cy)

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)

Set pen stroke width.

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

  • width Pen stroke width.

Finish path with specified operations.

Trait Implementations

Returns the “default value” for a type. Read more

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.