pub struct FractionalOffsetTween {
pub begin: Option<FractionalOffset>,
pub end: Option<FractionalOffset>,
}Expand description
An interpolation between two fractional offsets.
This class specializes the interpolation of Tween<FractionalOffset> to be
appropriate for fractional offsets.
See Tween for a discussion on how to use interpolation objects.
Unlike the tweens in inset_animation, this one is a value rather than an arena object:
the orphan rule leaves no local type in impl Animatable<Option<FractionalOffset>> for Handle<FractionalOffsetTween>. A driven animation therefore holds a clone, and writing
begin or end afterwards does not reach it.
See also:
AlignmentTween, which interpolates between twoAlignmentobjects.
Fields§
§begin: Option<FractionalOffset>The value this variable has at the beginning of the animation.
end: Option<FractionalOffset>The value this variable has at the end of the animation.
Implementations§
Source§impl FractionalOffsetTween
impl FractionalOffsetTween
Sourcepub fn new(
begin: Option<FractionalOffset>,
end: Option<FractionalOffset>,
) -> FractionalOffsetTween
pub fn new( begin: Option<FractionalOffset>, end: Option<FractionalOffset>, ) -> FractionalOffsetTween
Sourcepub fn lerp(&self, t: f64) -> Option<FractionalOffset>
pub fn lerp(&self, t: f64) -> Option<FractionalOffset>
Returns the value this variable has at the given animation clock value.
Trait Implementations§
Source§impl Animatable<Option<FractionalOffset>> for FractionalOffsetTween
impl Animatable<Option<FractionalOffset>> for FractionalOffsetTween
Source§fn transform(&self, _app: &App, t: f64) -> Option<FractionalOffset>
fn transform(&self, _app: &App, t: f64) -> Option<FractionalOffset>
Returns the value of the object at point
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,
The current value of this object for the given animation. Read more
Source§fn animate(self, app: &mut App, parent: AnyAnimation<f64>) -> AnyAnimation<T>
fn animate(self, app: &mut App, parent: AnyAnimation<f64>) -> AnyAnimation<T>
Returns a new
AnyAnimation that is driven by the given animation but
that takes on values determined by this object.Source§fn chain<P>(self, parent: P) -> ChainedEvaluation<P, Self>
fn chain<P>(self, parent: P) -> ChainedEvaluation<P, Self>
Returns a new
Animatable whose value is determined by first
evaluating the given parent and then evaluating this object at the
result.Source§impl Clone for FractionalOffsetTween
impl Clone for FractionalOffsetTween
Auto Trait Implementations§
impl Freeze for FractionalOffsetTween
impl RefUnwindSafe for FractionalOffsetTween
impl Send for FractionalOffsetTween
impl Sync for FractionalOffsetTween
impl Unpin for FractionalOffsetTween
impl UnsafeUnpin for FractionalOffsetTween
impl UnwindSafe for FractionalOffsetTween
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
Mutably borrows from an owned value. Read more