pub struct Stroke {
pub width: f64,
pub cap: StrokeCap,
pub join: StrokeJoin,
pub dash: Option<DashPattern>,
}Expand description
Describes the visual style of a stroked path.
Fields§
§width: f64The width of the stroke in device-independent units.
cap: StrokeCapThe shape used at the endpoints of open sub-paths.
join: StrokeJoinThe shape used at corners where two path segments meet.
dash: Option<DashPattern>An optional dash pattern; None means a solid stroke.
Implementations§
Source§impl Stroke
impl Stroke
Sourcepub fn new(width: f64) -> Self
pub fn new(width: f64) -> Self
Creates a solid stroke with the given width.
Defaults to StrokeCap::Butt, StrokeJoin::Miter, and no dash
pattern.
Sourcepub fn with_dash(self, pattern: DashPattern) -> Self
pub fn with_dash(self, pattern: DashPattern) -> Self
Sets the dash pattern on this stroke (builder-style).
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Stroke
impl RefUnwindSafe for Stroke
impl Send for Stroke
impl Sync for Stroke
impl Unpin for Stroke
impl UnsafeUnpin for Stroke
impl UnwindSafe for Stroke
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