pub struct Stroke {
pub width: f32,
pub paint: Paint,
pub cap: LineCap,
pub join: LineJoin,
pub miter_limit: f32,
pub dash: Option<DashPattern>,
}Expand description
Stroke style for a path’s outline.
Fields§
§width: f32§paint: Paint§cap: LineCap§join: LineJoin§miter_limit: f32Miter limit ratio. SVG / PDF default is 4.0.
dash: Option<DashPattern>Implementations§
Source§impl Stroke
impl Stroke
Sourcepub fn solid(width: f32, color: Rgba) -> Self
pub fn solid(width: f32, color: Rgba) -> Self
Build a default solid-paint stroke with width width.
Sourcepub fn new(width: f32, paint: Paint) -> Self
pub fn new(width: f32, paint: Paint) -> Self
Build a stroke with the given width and paint, and SVG/PDF
default cap (Butt), join (Miter), miter limit (4.0), and
no dash pattern.
Sourcepub fn with_paint(self, paint: Paint) -> Self
pub fn with_paint(self, paint: Paint) -> Self
Replace the stroke paint.
Sourcepub fn with_miter_limit(self, miter_limit: f32) -> Self
pub fn with_miter_limit(self, miter_limit: f32) -> Self
Set the miter limit ratio (SVG/PDF default is 4.0).
Sourcepub fn with_dash(self, dash: DashPattern) -> Self
pub fn with_dash(self, dash: DashPattern) -> Self
Set the dash pattern.
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