Struct nannou::geom::path::Builder

source ·
pub struct Builder { /* private fields */ }
Expand description

A type used for building a 2D lyon path.

Implementations§

source§

impl Builder

source

pub fn new() -> Self

Begin building a new path.

source

pub fn with_capacity(points: usize, edges: usize) -> Self

Build a path with the given capacity for the inner path event storage.

source

pub fn with_svg(self) -> WithSvg<Self>

Returns a lyon builder that supports SVG commands.

source

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

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

source

pub fn begin(self, to: Point2) -> Self

Sets the position in preparation for the next sub-path.

If the current sub-path contains edges, this ends the sub-path without closing it.

source

pub fn line_to(self, to: Point2) -> Self

Adds a line segment to the current sub-path and sets the current position.

source

pub fn close(self) -> Self

Closes the current sub path and sets the current position to the first position of the current sub-path.

source

pub fn quadratic_bezier_to(self, ctrl: Point2, to: Point2) -> Self

Add a quadratic bezier curve to the path.

source

pub fn cubic_bezier_to(self, ctrl1: Point2, ctrl2: Point2, to: Point2) -> Self

Add a cubic bezier curve to the path.

source

pub fn build(self) -> Path

Build the path and return it.

source

pub fn inner(&self) -> &Builder

Access to the inner lyon::path::Builder.

source

pub fn inner_mut(&mut self) -> &mut Builder

Mutable access to the inner lyon::path::Builder.

Trait Implementations§

source§

impl Build for Builder

§

type PathType = Path

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

fn build(self) -> Self::PathType

Builds a path object and resets the builder so that it can be used again.
source§

impl From<Builder> for Builder

source§

fn from(builder: Builder) -> Self

Converts to this type from the input type.
source§

impl Into<Builder> for Builder

source§

fn into(self) -> Builder

Converts this type into the (usually inferred) input type.
source§

impl PathBuilder for Builder

source§

fn quadratic_bezier_to(&mut self, ctrl: Point, to: Point) -> 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 ) -> EndpointId

Adds a cubic bézier curve to the current sub-path. Read more
source§

fn begin(&mut self, at: Point) -> 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) -> EndpointId

Adds a line segment to the current sub-path. 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>> )

Applies the provided path event. Read more
source§

fn extend<Evts>(&mut self, events: Evts)

Adds events from an iterator.
source§

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

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

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

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

fn add_line_segment( &mut self, line: &LineSegment<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 )

Adds a sub-path containing an ellipse. Read more
source§

fn add_circle( &mut self, center: Point2D<f32, UnknownUnit>, radius: f32, winding: Winding )
where Self: Sized,

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

fn add_rectangle(&mut self, rect: &Rect<f32, UnknownUnit>, winding: Winding)

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

fn add_rounded_rectangle( &mut self, rect: &Rect<f32, UnknownUnit>, radii: &BorderRadii, winding: Winding )
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§

Blanket Implementations§

source§

impl<S, D, Swp, Dwp, T> AdaptInto<D, Swp, Dwp, T> for S
where T: Component + Float, Swp: WhitePoint, Dwp: WhitePoint, D: AdaptFrom<S, Swp, Dwp, T>,

source§

fn adapt_into_using<M>(self, method: M) -> D
where M: TransformMatrix<Swp, Dwp, T>,

Convert the source color to the destination color using the specified method
source§

fn adapt_into(self) -> D

Convert the source color to the destination color using the bradford method by default
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, U> ConvertInto<U> for T
where U: ConvertFrom<T>,

source§

fn convert_into(self) -> U

Convert into T with values clamped to the color defined bounds Read more
source§

fn convert_unclamped_into(self) -> U

Convert into T. The resulting color might be invalid in its color space Read more
source§

fn try_convert_into(self) -> Result<U, OutOfBounds<U>>

Convert into T, returning ok if the color is inside of its defined range, otherwise an OutOfBounds error is returned which contains the unclamped color. Read more
source§

impl<T> Downcast<T> for T

source§

fn downcast(&self) -> &T

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> Pointable for T

source§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
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.
source§

impl<T> Upcast<T> for T

source§

fn upcast(&self) -> Option<&T>

source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

source§

fn vzip(self) -> V

source§

impl<T> WasmNotSend for T
where T: Send,

source§

impl<T> WasmNotSync for T
where T: Sync,