[][src]Trait lyon_path::builder::FlatPathBuilder

pub trait FlatPathBuilder: Sized {
    type PathType;
    fn move_to(&mut self, to: Point);
fn line_to(&mut self, to: Point);
fn close(&mut self);
fn build(self) -> Self::PathType;
fn build_and_reset(&mut self) -> Self::PathType;
fn current_position(&self) -> Point; fn flat_event(&mut self, event: FlattenedEvent) { ... }
fn flattened(self, tolerance: f32) -> FlatteningBuilder<Self> { ... } }

The most basic path building interface. Does not handle any kind of curve.

Associated Types

type PathType

The type of object that is created by this builder.

Loading content...

Required methods

fn move_to(&mut self, to: Point)

Sets the current position in preparation for the next sub-path. If the current sub-path contains edges, this ends the sub-path without closing it.

fn line_to(&mut self, to: Point)

Adds a line segment to the current sub-path and set the current position.

fn close(&mut self)

Closes the current sub path and sets the current position to the first position of this the current sub-path.

Subsequent commands will affect the next sub-path.

fn build(self) -> Self::PathType

Builds a path object and resets the builder so that it can be used again.

fn build_and_reset(&mut self) -> Self::PathType

Builds a path object and resets the builder so that it can be used again.

fn current_position(&self) -> Point

Loading content...

Provided methods

fn flat_event(&mut self, event: FlattenedEvent)

fn flattened(self, tolerance: f32) -> FlatteningBuilder<Self>

Returns a builder that approximates all curves with sequences of line segments.

Loading content...

Implementors

impl FlatPathBuilder for Builder[src]

type PathType = Path

impl<Builder: FlatPathBuilder> FlatPathBuilder for FlatteningBuilder<Builder>[src]

type PathType = Builder::PathType

impl<Builder: PathBuilder> FlatPathBuilder for SvgPathBuilder<Builder>[src]

type PathType = Builder::PathType

Loading content...