Struct tiny_skia::PathBuilder [−][src]
pub struct PathBuilder { /* fields omitted */ }
Expand description
A path builder.
Implementations
Creates a new builder with a specified capacity.
Number of points depends on a verb type:
- Move - 1
- Line - 1
- Quad - 2
- Cubic - 3
- Close - 0
Creates a new Path
from Rect
.
Never fails since Rect
is always valid.
Segments are created clockwise: TopLeft -> TopRight -> BottomRight -> BottomLeft
The contour is closed.
Creates a new Path
from a circle.
The contour is closed and has a clock-wise direction.
Returns None
when:
radius
<= 0- any value is not finite or really large
Adds beginning of a contour.
Multiple continuous MoveTo segments are not allowed. If the previous segment was also MoveTo, it will be overwritten with the current one.
Adds a line from the last point.
- If
Path
is empty - adds Move(0, 0) first. - If
Path
ends with Close - adds Move(last_x, last_y) first.
Adds a quad curve from the last point to x
, y
.
- If
Path
is empty - adds Move(0, 0) first. - If
Path
ends with Close - adds Move(last_x, last_y) first.
Adds a cubic curve from the last point to x
, y
.
- If
Path
is empty - adds Move(0, 0) first. - If
Path
ends with Close - adds Move(last_x, last_y) first.
Closes the current contour.
A closed contour connects the first and the last Point with a line, forming a continuous loop.
Does nothing when Path
is empty or already closed.
Open and closed contour will be filled the same way. Stroking an open contour will add LineCap at contour’s start and end. Stroking an closed contour will add LineJoin at contour’s start and end.
Adds a rectangle contour.
The contour is closed and has a clock-wise direction.
Does nothing when:
- any value is not finite or really large
Adds a circle contour.
The contour is closed and has a clock-wise direction.
Does nothing when:
radius
<= 0- any value is not finite or really large
Trait Implementations
Returns the “default value” for a type. Read more
Auto Trait Implementations
impl RefUnwindSafe for PathBuilder
impl Send for PathBuilder
impl Sync for PathBuilder
impl Unpin for PathBuilder
impl UnwindSafe for PathBuilder
Blanket Implementations
Mutably borrows from an owned value. Read more