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: FillStyleThe color or gradient of the stroke.
By default, it is set to a [Style::Solid] with [Color::BLACK].
width: f32The distance between the two edges of the stroke.
line_cap: LineCapThe shape to be used at the end of open subpaths when they are stroked.
line_join: LineJoinThe 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>
impl<'a> Stroke<'a>
Sourcepub fn with_color(self, color: PackedSrgb) -> Self
pub fn with_color(self, color: PackedSrgb) -> Self
Sets the color of the Stroke.
Sourcepub fn with_width(self, width: f32) -> Self
pub fn with_width(self, width: f32) -> Self
Sets the width of the Stroke.
Sourcepub fn with_line_cap(self, line_cap: LineCap) -> Self
pub fn with_line_cap(self, line_cap: LineCap) -> Self
Sourcepub fn with_line_join(self, line_join: LineJoin) -> Self
pub fn with_line_join(self, line_join: LineJoin) -> Self
Trait Implementations§
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> 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