Trait zeno::PathBuilder [−][src]
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]
&mut self,
control1: impl Into<Point>,
control2: impl Into<Point>,
to: impl Into<Point>
) -> &mut Self
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]
&mut self,
control1: impl Into<Point>,
to: impl Into<Point>
) -> &mut Self
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.
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]
&mut self,
control1: impl Into<Point>,
control2: impl Into<Point>,
to: impl Into<Point>
) -> &mut Self
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]
&mut self,
control: impl Into<Point>,
to: impl Into<Point>
) -> &mut Self
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]
&mut self,
rx: f32,
ry: f32,
angle: Angle,
size: ArcSize,
sweep: ArcSweep,
to: impl Into<Point>
) -> &mut Self
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]
&mut self,
rx: f32,
ry: f32,
angle: Angle,
size: ArcSize,
sweep: ArcSweep,
to: impl Into<Point>
) -> &mut Self
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]
&mut self,
xy: impl Into<Point>,
w: f32,
h: f32,
rx: f32,
ry: f32
) -> &mut Self
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]
&mut self,
center: impl Into<Point>,
rx: f32,
ry: f32
) -> &mut Self
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.
Implementations on Foreign Types
impl PathBuilder for Vec<Command>
[src]
fn current_point(&self) -> Point
[src]
fn move_to(&mut self, to: impl Into<Point>) -> &mut Self
[src]
fn line_to(&mut self, to: impl Into<Point>) -> &mut Self
[src]
fn quad_to(
&mut self,
control: impl Into<Point>,
to: impl Into<Point>
) -> &mut Self
[src]
&mut self,
control: impl Into<Point>,
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
[src]
&mut self,
control1: impl Into<Point>,
control2: impl Into<Point>,
to: impl Into<Point>
) -> &mut Self