Struct lyon_tessellation::StrokeBuilder
source · pub struct StrokeBuilder<'l> { /* private fields */ }
Expand description
A builder object that tessellates a stroked path via the PathBuilder
interface.
Can be created using StrokeTessellator::builder_with_attributes
.
Implementations
sourceimpl<'l> StrokeBuilder<'l>
impl<'l> StrokeBuilder<'l>
pub fn set_line_join(&mut self, join: LineJoin)
pub fn set_start_cap(&mut self, cap: LineCap)
pub fn set_end_cap(&mut self, cap: LineCap)
pub fn set_miter_limit(&mut self, limit: f32)
Trait Implementations
sourceimpl<'l> Build for StrokeBuilder<'l>
impl<'l> Build for StrokeBuilder<'l>
type PathType = Result<(), TessellationError>
type PathType = Result<(), TessellationError>
The type of object that is created by this builder.
sourcefn build(self) -> TessellationResult
fn build(self) -> TessellationResult
Builds a path object, consuming the builder.
sourceimpl<'l> PathBuilder for StrokeBuilder<'l>
impl<'l> PathBuilder for StrokeBuilder<'l>
fn num_attributes(&self) -> usize
sourcefn begin(&mut self, to: Point, attributes: Attributes<'_>) -> EndpointId
fn begin(&mut self, to: Point, attributes: Attributes<'_>) -> EndpointId
Starts a new sub-path at a given position. Read more
sourcefn line_to(&mut self, to: Point, attributes: Attributes<'_>) -> EndpointId
fn line_to(&mut self, to: Point, attributes: Attributes<'_>) -> EndpointId
Adds a line segment to the current sub-path. Read more
sourcefn quadratic_bezier_to(
&mut self,
ctrl: Point,
to: Point,
attributes: Attributes<'_>
) -> EndpointId
fn quadratic_bezier_to(
&mut self,
ctrl: Point,
to: Point,
attributes: Attributes<'_>
) -> EndpointId
Adds a quadratic bézier curve to the current sub-path. Read more
sourcefn cubic_bezier_to(
&mut self,
ctrl1: Point,
ctrl2: Point,
to: Point,
attributes: Attributes<'_>
) -> EndpointId
fn cubic_bezier_to(
&mut self,
ctrl1: Point,
ctrl2: Point,
to: Point,
attributes: Attributes<'_>
) -> EndpointId
Adds a cubic bézier curve to the current sub-path. Read more
sourcefn add_rectangle(
&mut self,
rect: &Box2D,
winding: Winding,
attributes: Attributes<'_>
)
fn add_rectangle(
&mut self,
rect: &Box2D,
winding: Winding,
attributes: Attributes<'_>
)
Adds a sub-path containing a rectangle. Read more
sourcefn reserve(&mut self, _endpoints: usize, _ctrl_points: usize)
fn reserve(&mut self, _endpoints: usize, _ctrl_points: usize)
Hints at the builder that a certain number of endpoints and control
points will be added. Read more
sourcefn path_event(
&mut self,
event: Event<Point2D<f32, UnknownUnit>, Point2D<f32, UnknownUnit>>,
attributes: &[f32]
)
fn path_event(
&mut self,
event: Event<Point2D<f32, UnknownUnit>, Point2D<f32, UnknownUnit>>,
attributes: &[f32]
)
Applies the provided path event. Read more
fn event(
&mut self,
event: Event<(Point2D<f32, UnknownUnit>, &[f32]), Point2D<f32, UnknownUnit>>
)
sourcefn add_polygon(
&mut self,
polygon: Polygon<'_, Point2D<f32, UnknownUnit>>,
attributes: &[f32]
)
fn add_polygon(
&mut self,
polygon: Polygon<'_, Point2D<f32, UnknownUnit>>,
attributes: &[f32]
)
Adds a sub-path from a polygon. Read more
sourcefn add_point(
&mut self,
at: Point2D<f32, UnknownUnit>,
attributes: &[f32]
) -> EndpointId
fn add_point(
&mut self,
at: Point2D<f32, UnknownUnit>,
attributes: &[f32]
) -> EndpointId
Adds a sub-path containing a single point. Read more
sourcefn add_line_segment(
&mut self,
line: &LineSegment<f32>,
attributes: &[f32]
) -> (EndpointId, EndpointId)
fn add_line_segment(
&mut self,
line: &LineSegment<f32>,
attributes: &[f32]
) -> (EndpointId, EndpointId)
Adds a sub-path containing a single line segment. Read more
sourcefn add_ellipse(
&mut self,
center: Point2D<f32, UnknownUnit>,
radii: Vector2D<f32, UnknownUnit>,
x_rotation: Angle<f32>,
winding: Winding,
attributes: &[f32]
)
fn add_ellipse(
&mut self,
center: Point2D<f32, UnknownUnit>,
radii: Vector2D<f32, UnknownUnit>,
x_rotation: Angle<f32>,
winding: Winding,
attributes: &[f32]
)
Adds a sub-path containing an ellipse. Read more
sourcefn add_circle(
&mut self,
center: Point2D<f32, UnknownUnit>,
radius: f32,
winding: Winding,
attributes: &[f32]
)where
Self: Sized,
fn add_circle(
&mut self,
center: Point2D<f32, UnknownUnit>,
radius: f32,
winding: Winding,
attributes: &[f32]
)where
Self: Sized,
Adds a sub-path containing a circle. Read more
sourcefn add_rounded_rectangle(
&mut self,
rect: &Box2D<f32, UnknownUnit>,
radii: &BorderRadii,
winding: Winding,
custom_attributes: &[f32]
)where
Self: Sized,
fn add_rounded_rectangle(
&mut self,
rect: &Box2D<f32, UnknownUnit>,
radii: &BorderRadii,
winding: Winding,
custom_attributes: &[f32]
)where
Self: Sized,
Adds a sub-path containing a rectangle. Read more
sourcefn flattened(self, tolerance: f32) -> Flattened<Self>where
Self: Sized,
fn flattened(self, tolerance: f32) -> Flattened<Self>where
Self: Sized,
Returns a builder that approximates all curves with sequences of line segments.
sourcefn transformed<Transform>(
self,
transform: Transform
) -> Transformed<Self, Transform>where
Self: Sized,
Transform: Transformation<f32>,
fn transformed<Transform>(
self,
transform: Transform
) -> Transformed<Self, Transform>where
Self: Sized,
Transform: Transformation<f32>,
Returns a builder that applies the given transformation to all positions.
Auto Trait Implementations
impl<'l> !RefUnwindSafe for StrokeBuilder<'l>
impl<'l> !Send for StrokeBuilder<'l>
impl<'l> !Sync for StrokeBuilder<'l>
impl<'l> Unpin for StrokeBuilder<'l>
impl<'l> !UnwindSafe for StrokeBuilder<'l>
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more