[F] Fix june flicker #408

This commit is contained in:
Azalea Gui 2025-08-21 11:48:24 -04:00
parent b28aa0ddf2
commit d6f9d1f569
4 changed files with 7 additions and 5 deletions

2
Cargo.lock generated
View file

@ -251,7 +251,7 @@ checksum = "2304e00983f87ffb38b55b444b5e3b60a884b5d30c0fca7d82fe33449bbe55ea"
[[package]]
name = "hyfetch"
version = "2.0.0-rc7"
version = "2.0.0"
dependencies = [
"aho-corasick",
"ansi_colours",

View file

@ -3,7 +3,7 @@ resolver = "2"
members = ["crates/*"]
[workspace.package]
version = "2.0.0-rc7"
version = "2.0.0"
authors = ["Azalea Gui <azalea@hydev.org>"]
edition = "2021"
rust-version = "1.75.0"

View file

@ -307,11 +307,13 @@ pub fn start_animation(color_mode: AnsiMode) -> Result<()> {
let mut frame: Wrapping<usize> = Wrapping(0);
const SPEED: u8 = 2;
let frame_delay = Duration::from_secs_f32(1.0 / 25.0);
let frame_delay = Duration::from_secs_f32(2.0 / 25.0);
execute!(io::stdout(), EnterAlternateScreen).context("failed to enter alternate screen")?;
loop {
// Move cursor to the top left corner
print!("\x1B[H");
draw_frame(frame.0)?;
frame += usize::from(SPEED);
thread::sleep(frame_delay);

View file

@ -105,8 +105,8 @@ def start_animation():
try:
while 1:
# Clear the screen
print("\033[2J\033[H", end="")
# Move cursor to the top left corner
print("\033[H", end="")
draw_frame()
frame += speed
sleep(frame_delay)