pub struct PathBuilder {
pub raw: WithSvg<BuilderImpl>,
}Fields§
§raw: WithSvg<BuilderImpl>Implementations§
Source§impl PathBuilder
impl PathBuilder
Sourcepub fn move_to(self, point: Point) -> Self
pub fn move_to(self, point: Point) -> Self
Moves the starting point of a new sub-path to the given Point.
Sourcepub fn line_to(self, point: Point) -> Self
pub fn line_to(self, point: Point) -> Self
Connects the last point in the Path to the given Point with a
straight line.
Sourcepub fn arc(self, arc: ArcPath) -> Self
pub fn arc(self, arc: ArcPath) -> Self
Adds an [Arc] to the Path from start_angle to end_angle in
a clockwise direction.
Sourcepub fn arc_to(self, a: Point, b: Point, radius: f32) -> Self
pub fn arc_to(self, a: Point, b: Point, radius: f32) -> Self
Adds a circular arc to the Path with the given control points and
radius.
This essentially draws a straight line segment from the current
position to a, but fits a circular arc of radius tangent to that
segment and tangent to the line between a and b.
With another .line_to(b), the result will be a path connecting the
starting point and b with straight line segments towards a and a
circular arc smoothing out the corner at a.
See the HTML5 specification of arcTo
for more details and examples.
Sourcepub fn ellipse(self, arc: EllipticalArcPath) -> Self
pub fn ellipse(self, arc: EllipticalArcPath) -> Self
Adds an ellipse to the Path using a clockwise direction.
Sourcepub fn bezier_curve_to(
self,
control_a: Point,
control_b: Point,
to: Point,
) -> Self
pub fn bezier_curve_to( self, control_a: Point, control_b: Point, to: Point, ) -> Self
Adds a cubic Bézier curve to the Path given its two control points
and its end point.
Sourcepub fn quadratic_curve_to(self, control: Point, to: Point) -> Self
pub fn quadratic_curve_to(self, control: Point, to: Point) -> Self
Adds a quadratic Bézier curve to the Path given its control point
and its end point.
Sourcepub fn rectangle(self, top_left: Point, size: Size) -> Self
pub fn rectangle(self, top_left: Point, size: Size) -> Self
Adds a rectangle to the Path given its top-left corner coordinate
and its Size.
Sourcepub fn circle(self, center: Point, radius: f32) -> Self
pub fn circle(self, center: Point, radius: f32) -> Self
Adds a circle to the Path given its center coordinate and its
radius.
Sourcepub fn close(self) -> Self
pub fn close(self) -> Self
Closes the current sub-path in the Path with a straight line to
the starting point.
Sourcepub fn build(self) -> Path
pub fn build(self) -> Path
Builds the Path of this PathBuilder.