pub struct DecorationTween {
pub begin: Option<DecorationRef>,
pub end: Option<DecorationRef>,
}Expand description
An interpolation between two [Decoration]s.
This class specializes the interpolation of Tween<Decoration> to use
DecorationRef::lerp.
See Tween for a discussion on how to use interpolation objects.
Unlike the tweens in waft_animation, this one is a value rather than an arena object:
the orphan rule leaves no local type in impl Animatable<DecorationRef> for Ref<DecorationTween>. A driven animation therefore holds a clone, and writing
begin or end afterwards does not reach it.
Fields§
§begin: Option<DecorationRef>The value this variable has at the beginning of the animation.
end: Option<DecorationRef>The value this variable has at the end of the animation.
Implementations§
Source§impl DecorationTween
impl DecorationTween
Sourcepub fn new(
begin: Option<DecorationRef>,
end: Option<DecorationRef>,
) -> DecorationTween
pub fn new( begin: Option<DecorationRef>, end: Option<DecorationRef>, ) -> DecorationTween
Creates a decoration tween.
Sourcepub fn lerp(&self, t: f64) -> DecorationRef
pub fn lerp(&self, t: f64) -> DecorationRef
Returns the value this variable has at the given animation clock value.
Trait Implementations§
Source§impl Animatable<DecorationRef> for DecorationTween
impl Animatable<DecorationRef> for DecorationTween
Source§fn transform(&self, _app: &App, t: f64) -> DecorationRef
fn transform(&self, _app: &App, t: f64) -> DecorationRef
t. Read moreSource§fn evaluate(&self, app: &App, animation: AnyAnimation<f64>) -> Twhere
Self: Sized,
fn evaluate(&self, app: &App, animation: AnyAnimation<f64>) -> Twhere
Self: Sized,
Source§fn animate(
self,
app: &mut App,
parent: Retained<AnyAnimation<f64>>,
) -> Retained<AnyAnimation<T>>
fn animate( self, app: &mut App, parent: Retained<AnyAnimation<f64>>, ) -> Retained<AnyAnimation<T>>
parent; whoever keeps the result keeps both.Source§fn chain<P>(self, parent: P) -> ChainedEvaluation<P, Self>
fn chain<P>(self, parent: P) -> ChainedEvaluation<P, Self>
Animatable whose value is determined by first
evaluating the given parent and then evaluating this object at the
result.Source§impl Clone for DecorationTween
impl Clone for DecorationTween
Source§impl Debug for DecorationTween
impl Debug for DecorationTween
Source§impl Display for DecorationTween
Dart’s Tween.toString, which an implicit animation’s state dump prints.
impl Display for DecorationTween
Dart’s Tween.toString, which an implicit animation’s state dump prints.