pub struct Dash {
pub intervals: Vec<f32>,
pub phase: f32,
}Expand description
A dash pattern: alternating drawn and skipped lengths, and where to start.
Fields§
§intervals: Vec<f32>Alternating drawn and skipped lengths, starting with a drawn one.
In the same space the path is in, so a pattern travels through the canvas transform with the geometry rather than staying fixed on screen.
phase: f32How far into the pattern the path starts.
Wrapped into one period, so any value is meaningful and an animation can simply keep adding to it.
Implementations§
Source§impl Dash
impl Dash
pub fn new(intervals: Vec<f32>, phase: f32) -> Self
Sourcepub fn is_usable(&self) -> bool
pub fn is_usable(&self) -> bool
Whether this pattern describes something that can be walked.
A pattern of nothing, of negative lengths, or of lengths that sum to zero has no period to advance through, and walking one would not terminate. Such a pattern is treated as no pattern at all: the path is drawn whole, which is the one behavior that cannot surprise anybody who got here by computing an interval that came out zero.
Trait Implementations§
impl StructuralPartialEq for Dash
Auto Trait Implementations§
impl Freeze for Dash
impl RefUnwindSafe for Dash
impl Send for Dash
impl Sync for Dash
impl Unpin for Dash
impl UnsafeUnpin for Dash
impl UnwindSafe for Dash
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§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> ⓘ
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> ⓘ
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