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§

source§

impl<'l> StrokeBuilder<'l>

source

pub fn set_line_join(&mut self, join: LineJoin)

source

pub fn set_start_cap(&mut self, cap: LineCap)

source

pub fn set_end_cap(&mut self, cap: LineCap)

source

pub fn set_miter_limit(&mut self, limit: f32)

Trait Implementations§

source§

impl<'l> Build for StrokeBuilder<'l>

§

type PathType = Result<(), TessellationError>

The type of object that is created by this builder.
source§

fn build(self) -> TessellationResult

Builds a path object, consuming the builder.
source§

impl<'l> PathBuilder for StrokeBuilder<'l>

source§

fn num_attributes(&self) -> usize

source§

fn begin(&mut self, to: Point, attributes: Attributes<'_>) -> EndpointId

Starts a new sub-path at a given position. Read more
source§

fn end(&mut self, close: bool)

Ends the current sub path. Read more
source§

fn line_to(&mut self, to: Point, attributes: Attributes<'_>) -> EndpointId

Adds a line segment to the current sub-path. Read more
source§

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
source§

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
source§

fn add_rectangle( &mut self, rect: &Box2D, winding: Winding, attributes: Attributes<'_> )

Adds a sub-path containing a rectangle. Read more
source§

fn close(&mut self)

Closes the current sub path. Read more
source§

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
source§

fn path_event( &mut self, event: Event<Point2D<f32, UnknownUnit>, Point2D<f32, UnknownUnit>>, attributes: &[f32] )

Applies the provided path event. Read more
source§

fn event( &mut self, event: Event<(Point2D<f32, UnknownUnit>, &[f32]), Point2D<f32, UnknownUnit>> )

source§

fn add_polygon( &mut self, polygon: Polygon<'_, Point2D<f32, UnknownUnit>>, attributes: &[f32] )

Adds a sub-path from a polygon. Read more
source§

fn add_point( &mut self, at: Point2D<f32, UnknownUnit>, attributes: &[f32] ) -> EndpointId

Adds a sub-path containing a single point. Read more
source§

fn add_line_segment( &mut self, line: &LineSegment<f32>, attributes: &[f32] ) -> (EndpointId, EndpointId)

Adds a sub-path containing a single line segment. Read more
source§

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
source§

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
source§

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
source§

fn flattened(self, tolerance: f32) -> Flattened<Self>
where Self: Sized,

Returns a builder that approximates all curves with sequences of line segments.
source§

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.
source§

fn with_svg(self) -> WithSvg<Self>
where Self: Sized,

Returns a builder that support SVG commands. Read more

Auto Trait Implementations§

§

impl<'l> Freeze for StrokeBuilder<'l>

§

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§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.