pub struct BoxConstraintsTween {
pub begin: Option<BoxConstraints>,
pub end: Option<BoxConstraints>,
}Expand description
An interpolation between two BoxConstraints.
This class specializes the interpolation of Tween<BoxConstraints> to use
BoxConstraints::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<BoxConstraints> for Ref<BoxConstraintsTween>. A driven animation therefore holds a clone, and writing
begin or end afterwards does not reach it.
Fields§
§begin: Option<BoxConstraints>The value this variable has at the beginning of the animation.
end: Option<BoxConstraints>The value this variable has at the end of the animation.
Implementations§
Source§impl BoxConstraintsTween
impl BoxConstraintsTween
Sourcepub fn new(
begin: Option<BoxConstraints>,
end: Option<BoxConstraints>,
) -> BoxConstraintsTween
pub fn new( begin: Option<BoxConstraints>, end: Option<BoxConstraints>, ) -> BoxConstraintsTween
Creates a BoxConstraints tween.
The begin and end properties may be None; the None
value is treated as a tight constraint of zero size.
Sourcepub fn lerp(&self, t: f64) -> BoxConstraints
pub fn lerp(&self, t: f64) -> BoxConstraints
Returns the value this variable has at the given animation clock value.
Trait Implementations§
Source§impl Animatable<BoxConstraints> for BoxConstraintsTween
impl Animatable<BoxConstraints> for BoxConstraintsTween
Source§fn transform(&self, _app: &App, t: f64) -> BoxConstraints
fn transform(&self, _app: &App, t: f64) -> BoxConstraints
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 BoxConstraintsTween
impl Clone for BoxConstraintsTween
Source§impl Debug for BoxConstraintsTween
impl Debug for BoxConstraintsTween
Source§impl Display for BoxConstraintsTween
Dart’s Tween.toString, which an implicit animation’s state dump prints.
impl Display for BoxConstraintsTween
Dart’s Tween.toString, which an implicit animation’s state dump prints.