pub struct Stroke<'a> {
pub width: f32,
pub join: Join,
pub miter_limit: f32,
pub start_cap: Cap,
pub end_cap: Cap,
pub dashes: &'a [f32],
pub offset: f32,
pub scale: bool,
}
Expand description
Describes the visual style of a stroke.
Fields§
§width: f32
Width of the stroke.
join: Join
Style for connecting segments of the stroke.
miter_limit: f32
Limit for miter joins.
start_cap: Cap
Style for capping the beginning of an open subpath.
end_cap: Cap
Style for capping the end of an open subpath.
dashes: &'a [f32]
Lengths of dashes in alternating on/off order.
offset: f32
Offset of the first dash.
scale: bool
True if the stroke width should be affected by the scale of a transform.
Implementations§
source§impl<'a> Stroke<'a>
impl<'a> Stroke<'a>
sourcepub fn width(&mut self, width: f32) -> &mut Self
pub fn width(&mut self, width: f32) -> &mut Self
Sets the width of the stroke. The default is 1.
sourcepub fn join(&mut self, join: Join) -> &mut Self
pub fn join(&mut self, join: Join) -> &mut Self
Sets the join style that determines how individual segments of the path will be connected. The default is miter.
sourcepub fn miter_limit(&mut self, limit: f32) -> &mut Self
pub fn miter_limit(&mut self, limit: f32) -> &mut Self
Sets the limit for miter joins beyond which a bevel will be generated. The default is 4.
sourcepub fn cap(&mut self, cap: Cap) -> &mut Self
pub fn cap(&mut self, cap: Cap) -> &mut Self
Sets the cap style that will be generated at the start and end of the stroke. Note that this will override the individual start and end cap options. The default is butt.
sourcepub fn caps(&mut self, start: Cap, end: Cap) -> &mut Self
pub fn caps(&mut self, start: Cap, end: Cap) -> &mut Self
Sets both the start and end cap styles for the stroke.
Trait Implementations§
impl<'a> Copy for Stroke<'a>
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
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)