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