[][src]Struct zeno::Stroke

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,
}

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

impl<'a> Stroke<'a>[src]

pub fn new(width: f32) -> Self[src]

Creates a new stroke style with the specified width.

pub fn width(&mut self, width: f32) -> &mut Self[src]

Sets the width of the stroke. The default is 1.

pub fn join(&mut self, join: Join) -> &mut Self[src]

Sets the join style that determines how individual segments of the path will be connected. The default is miter.

pub fn miter_limit(&mut self, limit: f32) -> &mut Self[src]

Sets the limit for miter joins beyond which a bevel will be generated. The default is 4.

pub fn cap(&mut self, cap: Cap) -> &mut Self[src]

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.

pub fn caps(&mut self, start: Cap, end: Cap) -> &mut Self[src]

Sets both the start and end cap styles for the stroke.

pub fn dash(&mut self, dashes: &'a [f32], offset: f32) -> &mut Self[src]

Sets the dash array and offset of the stroke. The default is an empty array, meaning that the stroke will be drawn as a continuous line.

pub fn scale(&mut self, scale: bool) -> &mut Self[src]

Sets whether or not scaling is applied to the stroke. The default is true.

Trait Implementations

impl<'a> Clone for Stroke<'a>[src]

impl<'a> Copy for Stroke<'a>[src]

impl<'a> Debug for Stroke<'a>[src]

impl<'_> Default for Stroke<'_>[src]

impl<'a> From<&'a Stroke<'a>> for Style<'a>[src]

impl<'a> From<&'a mut Stroke<'a>> for Style<'a>[src]

impl<'a> From<Stroke<'a>> for Style<'a>[src]

Auto Trait Implementations

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

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.