pub struct PathBuilder {
pub style: PathStyle,
/* private fields */
}Expand description
A Path builder.
Fields§
§style: PathStylePathStyle of the PathBuilder
Implementations§
Source§impl PathBuilder
impl PathBuilder
Sourcepub fn stroke(width: Pixels) -> Self
pub fn stroke(width: Pixels) -> Self
Creates a new PathBuilder to build a Stroke path.
Sourcepub fn fill() -> Self
pub fn fill() -> Self
Creates a new PathBuilder to build a Fill path.
Sourcepub fn with_style(self, style: PathStyle) -> Self
pub fn with_style(self, style: PathStyle) -> Self
Sets the style of the PathBuilder.
Sourcepub fn dash_array(self, dash_array: &[Pixels]) -> Self
pub fn dash_array(self, dash_array: &[Pixels]) -> Self
Sets the dash array of the PathBuilder.
Sourcepub fn line_to(&mut self, to: Point<Pixels>)
pub fn line_to(&mut self, to: Point<Pixels>)
Draw a straight line from the current point to the given point.
Sourcepub fn curve_to(&mut self, to: Point<Pixels>, ctrl: Point<Pixels>)
pub fn curve_to(&mut self, to: Point<Pixels>, ctrl: Point<Pixels>)
Draw a curve from the current point to the given point, using the given control point.
Sourcepub fn cubic_bezier_to(
&mut self,
to: Point<Pixels>,
control_a: Point<Pixels>,
control_b: Point<Pixels>,
)
pub fn cubic_bezier_to( &mut self, to: Point<Pixels>, control_a: Point<Pixels>, control_b: Point<Pixels>, )
Adds a cubic Bézier to the Path given its two control points
and its end point.
Sourcepub fn arc_to(
&mut self,
radii: Point<Pixels>,
x_rotation: Pixels,
large_arc: bool,
sweep: bool,
to: Point<Pixels>,
)
pub fn arc_to( &mut self, radii: Point<Pixels>, x_rotation: Pixels, large_arc: bool, sweep: bool, to: Point<Pixels>, )
Adds an elliptical arc.
Sourcepub fn relative_arc_to(
&mut self,
radii: Point<Pixels>,
x_rotation: Pixels,
large_arc: bool,
sweep: bool,
to: Point<Pixels>,
)
pub fn relative_arc_to( &mut self, radii: Point<Pixels>, x_rotation: Pixels, large_arc: bool, sweep: bool, to: Point<Pixels>, )
Equivalent to arc_to in relative coordinates.
Sourcepub fn add_polygon(&mut self, points: &[Point<Pixels>], closed: bool)
pub fn add_polygon(&mut self, points: &[Point<Pixels>], closed: bool)
Adds a polygon.
Sourcepub fn rotate(&mut self, angle: f32)
pub fn rotate(&mut self, angle: f32)
Applies a rotation to the path.
The angle is in degrees value in the range 0.0 to 360.0.
Sourcepub fn build_path(buf: VertexBuffers<Point, u16>) -> Path<Pixels>
pub fn build_path(buf: VertexBuffers<Point, u16>) -> Path<Pixels>
Builds a Path from a lyon::tessellation::VertexBuffers.
Trait Implementations§
Source§impl Default for PathBuilder
impl Default for PathBuilder
Source§impl From<NoAttributes<BuilderImpl>> for PathBuilder
impl From<NoAttributes<BuilderImpl>> for PathBuilder
Source§impl From<WithSvg<BuilderImpl>> for PathBuilder
impl From<WithSvg<BuilderImpl>> for PathBuilder
Source§fn from(raw: WithSvg<BuilderImpl>) -> Self
fn from(raw: WithSvg<BuilderImpl>) -> Self
Converts to this type from the input type.
Auto Trait Implementations§
impl Freeze for PathBuilder
impl RefUnwindSafe for PathBuilder
impl Send for PathBuilder
impl Sync for PathBuilder
impl Unpin for PathBuilder
impl UnwindSafe for PathBuilder
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Convert
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Convert
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Convert
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Convert
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.Source§impl<T> DowncastSync for T
impl<T> DowncastSync for T
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<R, P> ReadPrimitive<R> for P
impl<R, P> ReadPrimitive<R> for P
Source§fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
Read this value from the supplied reader. Same as
ReadEndian::read_from_little_endian().