Trait zeno::PathBuilder[][src]

pub trait PathBuilder: Sized {
    fn current_point(&self) -> Point;
fn move_to(&mut self, to: impl Into<Point>) -> &mut Self;
fn line_to(&mut self, to: impl Into<Point>) -> &mut Self;
fn curve_to(
        &mut self,
        control1: impl Into<Point>,
        control2: impl Into<Point>,
        to: impl Into<Point>
    ) -> &mut Self;
fn quad_to(
        &mut self,
        control1: impl Into<Point>,
        to: impl Into<Point>
    ) -> &mut Self;
fn close(&mut self) -> &mut Self; fn rel_move_to(&mut self, to: impl Into<Point>) -> &mut Self { ... }
fn rel_line_to(&mut self, to: impl Into<Point>) -> &mut Self { ... }
fn rel_curve_to(
        &mut self,
        control1: impl Into<Point>,
        control2: impl Into<Point>,
        to: impl Into<Point>
    ) -> &mut Self { ... }
fn rel_quad_to(
        &mut self,
        control: impl Into<Point>,
        to: impl Into<Point>
    ) -> &mut Self { ... }
fn arc_to(
        &mut self,
        rx: f32,
        ry: f32,
        angle: Angle,
        size: ArcSize,
        sweep: ArcSweep,
        to: impl Into<Point>
    ) -> &mut Self { ... }
fn rel_arc_to(
        &mut self,
        rx: f32,
        ry: f32,
        angle: Angle,
        size: ArcSize,
        sweep: ArcSweep,
        to: impl Into<Point>
    ) -> &mut Self { ... }
fn add_rect(&mut self, xy: impl Into<Point>, w: f32, h: f32) -> &mut Self { ... }
fn add_round_rect(
        &mut self,
        xy: impl Into<Point>,
        w: f32,
        h: f32,
        rx: f32,
        ry: f32
    ) -> &mut Self { ... }
fn add_ellipse(
        &mut self,
        center: impl Into<Point>,
        rx: f32,
        ry: f32
    ) -> &mut Self { ... }
fn add_circle(&mut self, center: impl Into<Point>, r: f32) -> &mut Self { ... } }

Trait for types that accept path commands.

Required methods

fn current_point(&self) -> Point[src]

Returns the current point of the path.

fn move_to(&mut self, to: impl Into<Point>) -> &mut Self[src]

Moves to the specified point, beginning a new subpath.

fn line_to(&mut self, to: impl Into<Point>) -> &mut Self[src]

Adds a line to the specified point. This will begin a new subpath if the path is empty or the previous subpath was closed.

fn curve_to(
    &mut self,
    control1: impl Into<Point>,
    control2: impl Into<Point>,
    to: impl Into<Point>
) -> &mut Self
[src]

Adds a cubic bezier curve from the current point through the specified control points to the final point. This will begin a new subpath if the path is empty or the previous subpath was closed.

fn quad_to(
    &mut self,
    control1: impl Into<Point>,
    to: impl Into<Point>
) -> &mut Self
[src]

Adds a quadratic bezier curve from the current point through the specified control point to the final point. This will begin a new subpath if the path is empty or the previous subpath was closed.

fn close(&mut self) -> &mut Self[src]

Closes the current subpath.

Loading content...

Provided methods

fn rel_move_to(&mut self, to: impl Into<Point>) -> &mut Self[src]

Moves to the specified point, relative to the current point, beginning a new subpath.

fn rel_line_to(&mut self, to: impl Into<Point>) -> &mut Self[src]

Adds a line to the specified point, relative to the current point. This will begin a new subpath if the path is empty or the previous subpath was closed.

fn rel_curve_to(
    &mut self,
    control1: impl Into<Point>,
    control2: impl Into<Point>,
    to: impl Into<Point>
) -> &mut Self
[src]

Adds a cubic bezier curve from the current point through the specified control points to the final point. All points are considered relative to the current point. This will begin a new subpath if the path is empty or the previous subpath was closed.

fn rel_quad_to(
    &mut self,
    control: impl Into<Point>,
    to: impl Into<Point>
) -> &mut Self
[src]

Adds a quadratic bezier curve from the current point through the specified control point to the final point. All points are considered relative to the current point. This will begin a new subpath if the path is empty or the previous subpath was closed.

fn arc_to(
    &mut self,
    rx: f32,
    ry: f32,
    angle: Angle,
    size: ArcSize,
    sweep: ArcSweep,
    to: impl Into<Point>
) -> &mut Self
[src]

Adds an arc with the specified x- and y-radius, rotation angle, arc size, and arc sweep from the current point to the specified end point. The center point of the arc will be computed from the parameters. This will begin a new subpath if the path is empty or the previous subpath was closed.

fn rel_arc_to(
    &mut self,
    rx: f32,
    ry: f32,
    angle: Angle,
    size: ArcSize,
    sweep: ArcSweep,
    to: impl Into<Point>
) -> &mut Self
[src]

Adds an arc with the specified x- and y-radius, rotation angle, arc size, and arc sweep from the current point to the specified end point. The end point is considered relative to the current point. The center point of the arc will be computed from the parameters. This will begin a new subpath if the path is empty or the previous subpath was closed.

fn add_rect(&mut self, xy: impl Into<Point>, w: f32, h: f32) -> &mut Self[src]

Adds a rectangle with the specified position and size to the path. This will create a new closed subpath.

fn add_round_rect(
    &mut self,
    xy: impl Into<Point>,
    w: f32,
    h: f32,
    rx: f32,
    ry: f32
) -> &mut Self
[src]

Adds a rounded rectangle with the specified position, size and radii to the path. This will create a new closed subpath.

fn add_ellipse(
    &mut self,
    center: impl Into<Point>,
    rx: f32,
    ry: f32
) -> &mut Self
[src]

Adds an ellipse with the specified center and radii to the path. This will create a new closed subpath.

fn add_circle(&mut self, center: impl Into<Point>, r: f32) -> &mut Self[src]

Adds a circle with the specified center and radius to the path. This will create a new closed subpath.

Loading content...

Implementations on Foreign Types

impl PathBuilder for Vec<Command>[src]

Loading content...

Implementors

Loading content...