pub trait PathBuilder {
type Path: SharedOwnership;
// Required methods
fn move_to(&mut self, x: f32, y: f32);
fn line_to(&mut self, x: f32, y: f32);
fn quad_to(&mut self, x1: f32, y1: f32, x: f32, y: f32);
fn curve_to(&mut self, x1: f32, y1: f32, x2: f32, y2: f32, x: f32, y: f32);
fn close(&mut self);
fn finish(self) -> Self::Path;
}Expand description
The ResourceAllocator provides a path builder that defines how to build
paths that can be used with the renderer.
Required Associated Types§
Sourcetype Path: SharedOwnership
type Path: SharedOwnership
The type of the path to build. This needs to be identical to the type of
the path used by the ResourceAllocator.
Required Methods§
Sourcefn move_to(&mut self, x: f32, y: f32)
fn move_to(&mut self, x: f32, y: f32)
Moves the cursor to a specific position and starts a new contour.
Sourcefn line_to(&mut self, x: f32, y: f32)
fn line_to(&mut self, x: f32, y: f32)
Adds a line from the previous position to the position specified, while also moving the cursor along.
Sourcefn quad_to(&mut self, x1: f32, y1: f32, x: f32, y: f32)
fn quad_to(&mut self, x1: f32, y1: f32, x: f32, y: f32)
Adds a quadratic bézier curve from the previous position to the position specified, while also moving the cursor along. (x1, y1) specifies the control point.
Sourcefn curve_to(&mut self, x1: f32, y1: f32, x2: f32, y2: f32, x: f32, y: f32)
fn curve_to(&mut self, x1: f32, y1: f32, x2: f32, y2: f32, x: f32, y: f32)
Adds a cubic bézier curve from the previous position to the position specified, while also moving the cursor along. (x1, y1) and (x2, y2) specify the two control points.