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: f32Width of the stroke.
join: JoinStyle for connecting segments of the stroke.
miter_limit: f32Limit for miter joins.
start_cap: CapStyle for capping the beginning of an open subpath.
end_cap: CapStyle for capping the end of an open subpath.
dashes: &'a [f32]Lengths of dashes in alternating on/off order.
offset: f32Offset of the first dash.
scale: boolTrue 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.