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. Fills ignore it.
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.
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 Forget for PathBuilder
impl Freeze for PathBuilderwhere
*const u8 is !null: Freeze,
PhantomData<Point2D<f32, UnknownUnit>>: Freeze,
PhantomData<Verb>: Freeze,
PhantomData<UnknownUnit>: Freeze,
PhantomData<f32>: Freeze,
PhantomData<(UnknownUnit, UnknownUnit)>: Freeze,
PhantomData<Pixels>: Freeze,
impl Move for PathBuilder
impl RefUnwindSafe for PathBuilder
impl Send for PathBuilderwhere
RawVecInner: Send,
impl Sync for PathBuilderwhere
RawVecInner: Sync,
impl Unpin for PathBuilder
impl UnsafeUnpin for PathBuilderwhere
*const u8 is !null: UnsafeUnpin,
PhantomData<Point2D<f32, UnknownUnit>>: UnsafeUnpin,
PhantomData<Verb>: UnsafeUnpin,
PhantomData<UnknownUnit>: UnsafeUnpin,
PhantomData<f32>: UnsafeUnpin,
PhantomData<(UnknownUnit, UnknownUnit)>: UnsafeUnpin,
PhantomData<Pixels>: UnsafeUnpin,
impl UnwindSafe for PathBuilderwhere
RawVecInner: UnwindSafe,
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
impl<T> ErasedDestructor for Twhere
T: 'static,
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().