final refactors

This commit is contained in:
2026-06-11 22:17:46 -05:00
parent f249e109ed
commit 7f41f704ef
4 changed files with 26 additions and 23 deletions
+5 -2
View File
@@ -15,6 +15,9 @@ use ratatui::widgets::{
Widget, Wrap,
};
/// Duration of the open and close animations, in seconds.
const ANIM_SECS: f32 = 0.25;
/// Animation state for the scroll overlay window.
#[derive(Default)]
pub enum ScrollAnimState {
@@ -54,11 +57,11 @@ impl ScrollOverlayState {
pub fn advance_anim(&mut self, dt: f32) {
match &mut self.anim {
Some(ScrollAnimState::Opening(p)) => {
*p += dt / 0.5;
*p += dt / ANIM_SECS;
if *p >= 1.0 { self.anim = Some(ScrollAnimState::Open); }
}
Some(ScrollAnimState::Closing(p)) => {
*p -= dt / 0.5;
*p -= dt / ANIM_SECS;
if *p <= 0.0 { self.anim = Some(ScrollAnimState::Done); }
}
_ => {}