File tree Expand file tree Collapse file tree 1 file changed +11
-3
lines changed Expand file tree Collapse file tree 1 file changed +11
-3
lines changed Original file line number Diff line number Diff line change @@ -3965,9 +3965,17 @@ impl TilingLayout {
39653965 . then ( || & self . queue . trees . front ( ) . unwrap ( ) . 0 ) ;
39663966
39673967 let percentage = if let Some ( animation_start) = self . queue . animation_start {
3968- let percentage = Instant :: now ( ) . duration_since ( animation_start) . as_millis ( ) as f32
3969- / duration. as_millis ( ) as f32 ;
3970- ease ( EaseInOutCubic , 0.0 , 1.0 , percentage)
3968+ if * duration == Duration :: ZERO {
3969+ 1.0
3970+ } else {
3971+ let now = Instant :: now ( ) ;
3972+ let total = duration. as_millis ( ) as f32 ;
3973+ let since = now. duration_since ( animation_start) . as_millis ( ) as f32 ;
3974+ let percentage = since / total;
3975+ debug_assert ! ( !percentage. is_nan( ) ) ;
3976+ debug_assert ! ( !percentage. is_infinite( ) ) ;
3977+ ease ( EaseInOutCubic , 0.0 , 1.0 , percentage)
3978+ }
39713979 } else {
39723980 1.0
39733981 } ;
You can’t perform that action at this time.
0 commit comments