pub struct EdgeInsetsTween {
pub begin: Option<EdgeInsets>,
pub end: Option<EdgeInsets>,
}Expand description
An interpolation between two EdgeInsetss.
This class specializes the interpolation of Tween<EdgeInsets> to use
EdgeInsets::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<EdgeInsets> for Ref<EdgeInsetsTween>. A driven animation therefore holds a clone, and writing
begin or end afterwards does not reach it.
See also:
EdgeInsetsGeometryTween, which interpolates between twoEdgeInsetsGeometryobjects.
Fields§
§begin: Option<EdgeInsets>The value this variable has at the beginning of the animation.
end: Option<EdgeInsets>The value this variable has at the end of the animation.
Implementations§
Source§impl EdgeInsetsTween
impl EdgeInsetsTween
Sourcepub fn new(
begin: Option<EdgeInsets>,
end: Option<EdgeInsets>,
) -> EdgeInsetsTween
pub fn new( begin: Option<EdgeInsets>, end: Option<EdgeInsets>, ) -> EdgeInsetsTween
Creates an EdgeInsets tween.
The begin and end properties may be None; the None
value is treated as an EdgeInsets with no inset.
Sourcepub fn lerp(&self, t: f64) -> EdgeInsets
pub fn lerp(&self, t: f64) -> EdgeInsets
Returns the value this variable has at the given animation clock value.
Trait Implementations§
Source§impl Animatable<EdgeInsets> for EdgeInsetsTween
impl Animatable<EdgeInsets> for EdgeInsetsTween
Source§fn transform(&self, _app: &App, t: f64) -> EdgeInsets
fn transform(&self, _app: &App, t: f64) -> EdgeInsets
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.