pub fn update(&mut self, nanos: u64, ctx: &mut EventCtx) {
        // This must happen before updating the value!
        if self.animating() {
            if self.layout {
                ctx.request_layout();
            } else {
                ctx.request_paint();
            }
        }

        self.current_duration += (nanos as f64) * 0.000000001;
        self.current_duration = self.current_duration.min(self.full_duration);

        if self.animating() {
            ctx.request_anim_frame();
            self.current = self.start.interpolate(
                &self.end,
                self.curve
                    .translate(self.current_duration / self.full_duration),
            );
        } else {
            self.current = self.end.clone();
        }
    }
/// This method should always be called in Event::AnimationFrame.
/// It updates the value according to duration and curve.
/// If the value changes and the specific flags are set paint or layout are requested.
/// If the transition's end isn't reached an additional animation-frame is requested.
///
This method should always be called in Event::AnimationFrame.
It updates the value according to duration and curve.
If the value changes and the specific flags are set paint or layout are requested.
If the transition's end isn't reached an additional animation-frame is requested.
This method should always be called in Event :: AnimationFrame . It updates the value according to duration and curve . If the value changes and the specific flags are set paint or layout are requested . If the transition ' s end isn ' t reached an additional animation - frame is requested .
pub fn update(&mut self, nanos: u64, ctx: &mut EventCtx) {
        // This must happen before updating the value!
        if self.animating() {
            if self.layout {
                ctx.request_layout();
            } else {
                ctx.request_paint();
            }
        }
        self.current_duration += (nanos as f64) * 0.000000001;
        self.current_duration = self.current_duration.min(self.full_duration);
        if self.animating() {
            ctx.request_anim_frame();
            self.current = self.start.interpolate(
                &self.end,
                self.curve
                    .translate(self.current_duration / self.full_duration),
            );
        } else {
            self.current = self.end.clone();
        }
    }
pub fn update ( & mut self , nanos : u64 , ctx : & mut EventCtx ) { // This must happen before updating the value! if self . animating ( ) { if self . layout { ctx . request_layout ( ) ; } else { ctx . request_paint ( ) ; } } self . current_duration += ( nanos as f64 ) * 0.000000001 ; self . current_duration = self . current_duration . min ( self . full_duration ) ; if self . animating ( ) { ctx . request_anim_frame ( ) ; self . current = self . start . interpolate ( & self . end , self . curve . translate ( self . current_duration / self . full_duration ) , ) ; } else { self . current = self . end . clone ( ) ; } }
This method should always be called in Event::AnimationFrame.
This method should always be called in Event :: AnimationFrame .
&mut self
nanos
u64
ctx
&mut EventCtx