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.