pub struct StrokeStyle {
pub width: f64,
pub cap: LineCap,
pub join: LineJoin,
pub miter_limit: f64,
pub dash: Vec<f64>,
pub dash_phase: f64,
}Expand description
Everything about a stroke except its paint.
StrokeStyle::width and From<f64> keep the common “just a width” case a single
argument, so plain stroke(shape, color, 2.0) call sites read the same as they always did.
Fields§
§width: f64§cap: LineCap§join: LineJoin§miter_limit: f64Ignored unless join is LineJoin::Miter. The 2-D convention: past this ratio of miter
length to line width the join falls back to a bevel.
dash: Vec<f64>On/off run lengths, repeating. Empty means solid.
dash_phase: f64How far into the dash pattern the line starts.
Implementations§
Source§impl StrokeStyle
impl StrokeStyle
Sourcepub fn width(width: f64) -> StrokeStyle
pub fn width(width: f64) -> StrokeStyle
A solid stroke of width, everything else default.
Sourcepub fn dashed(width: f64, dash: Vec<f64>) -> StrokeStyle
pub fn dashed(width: f64, dash: Vec<f64>) -> StrokeStyle
A dashed stroke: dash is on/off run lengths, repeating.
Sourcepub fn round(width: f64) -> StrokeStyle
pub fn round(width: f64) -> StrokeStyle
Rounded ends and joins, the shape a data line usually wants.
Trait Implementations§
Source§impl Clone for StrokeStyle
impl Clone for StrokeStyle
Source§fn clone(&self) -> StrokeStyle
fn clone(&self) -> StrokeStyle
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for StrokeStyle
impl Debug for StrokeStyle
Source§impl Default for StrokeStyle
impl Default for StrokeStyle
Source§fn default() -> StrokeStyle
fn default() -> StrokeStyle
Returns the “default value” for a type. Read more
Source§impl From<f64> for StrokeStyle
impl From<f64> for StrokeStyle
Source§fn from(width: f64) -> StrokeStyle
fn from(width: f64) -> StrokeStyle
Converts to this type from the input type.
Source§impl PartialEq for StrokeStyle
impl PartialEq for StrokeStyle
impl StructuralPartialEq for StrokeStyle
Auto Trait Implementations§
impl Freeze for StrokeStyle
impl RefUnwindSafe for StrokeStyle
impl Send for StrokeStyle
impl Sync for StrokeStyle
impl Unpin for StrokeStyle
impl UnsafeUnpin for StrokeStyle
impl UnwindSafe for StrokeStyle
Blanket Implementations§
§impl<T> AnyEq for T
impl<T> AnyEq for T
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> ErasedDestructor for Twhere
T: 'static,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more