Stroke

Struct Stroke 

Source
pub struct Stroke<'a> {
    pub style: FillStyle,
    pub width: f32,
    pub line_cap: LineCap,
    pub line_join: LineJoin,
    pub line_dash: LineDash<'a>,
}
Expand description

The style of a stroke.

Fields§

§style: FillStyle

The color or gradient of the stroke.

By default, it is set to a [Style::Solid] with [Color::BLACK].

§width: f32

The distance between the two edges of the stroke.

§line_cap: LineCap

The shape to be used at the end of open subpaths when they are stroked.

§line_join: LineJoin

The shape to be used at the corners of paths or basic shapes when they are stroked.

§line_dash: LineDash<'a>

The dash pattern used when stroking the line.

Implementations§

Source§

impl<'a> Stroke<'a>

Source

pub fn with_color(self, color: PackedSrgb) -> Self

Sets the color of the Stroke.

Source

pub fn with_width(self, width: f32) -> Self

Sets the width of the Stroke.

Source

pub fn with_line_cap(self, line_cap: LineCap) -> Self

Sets the LineCap of the Stroke.

Source

pub fn with_line_join(self, line_join: LineJoin) -> Self

Sets the LineJoin of the Stroke.

Trait Implementations§

Source§

impl<'a> Clone for Stroke<'a>

Source§

fn clone(&self) -> Stroke<'a>

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<'a> Debug for Stroke<'a>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<'a> Default for Stroke<'a>

Source§

fn default() -> Self

Returns the “default value” for a type. Read more

Auto Trait Implementations§

§

impl<'a> Freeze for Stroke<'a>

§

impl<'a> RefUnwindSafe for Stroke<'a>

§

impl<'a> Send for Stroke<'a>

§

impl<'a> Sync for Stroke<'a>

§

impl<'a> Unpin for Stroke<'a>

§

impl<'a> UnwindSafe for Stroke<'a>

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. 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> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

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

Source§

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>,

Source§

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<T> WasmNotSend for T
where T: Send,

Source§

impl<T> WasmNotSendSync for T

Source§

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