[F] Fix june flicker #408
This commit is contained in:
parent
b28aa0ddf2
commit
d6f9d1f569
4 changed files with 7 additions and 5 deletions
2
Cargo.lock
generated
2
Cargo.lock
generated
|
|
@ -251,7 +251,7 @@ checksum = "2304e00983f87ffb38b55b444b5e3b60a884b5d30c0fca7d82fe33449bbe55ea"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "hyfetch"
|
name = "hyfetch"
|
||||||
version = "2.0.0-rc7"
|
version = "2.0.0"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"aho-corasick",
|
"aho-corasick",
|
||||||
"ansi_colours",
|
"ansi_colours",
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,7 @@ resolver = "2"
|
||||||
members = ["crates/*"]
|
members = ["crates/*"]
|
||||||
|
|
||||||
[workspace.package]
|
[workspace.package]
|
||||||
version = "2.0.0-rc7"
|
version = "2.0.0"
|
||||||
authors = ["Azalea Gui <azalea@hydev.org>"]
|
authors = ["Azalea Gui <azalea@hydev.org>"]
|
||||||
edition = "2021"
|
edition = "2021"
|
||||||
rust-version = "1.75.0"
|
rust-version = "1.75.0"
|
||||||
|
|
|
||||||
|
|
@ -307,11 +307,13 @@ pub fn start_animation(color_mode: AnsiMode) -> Result<()> {
|
||||||
let mut frame: Wrapping<usize> = Wrapping(0);
|
let mut frame: Wrapping<usize> = Wrapping(0);
|
||||||
|
|
||||||
const SPEED: u8 = 2;
|
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")?;
|
execute!(io::stdout(), EnterAlternateScreen).context("failed to enter alternate screen")?;
|
||||||
|
|
||||||
loop {
|
loop {
|
||||||
|
// Move cursor to the top left corner
|
||||||
|
print!("\x1B[H");
|
||||||
draw_frame(frame.0)?;
|
draw_frame(frame.0)?;
|
||||||
frame += usize::from(SPEED);
|
frame += usize::from(SPEED);
|
||||||
thread::sleep(frame_delay);
|
thread::sleep(frame_delay);
|
||||||
|
|
|
||||||
|
|
@ -105,8 +105,8 @@ def start_animation():
|
||||||
|
|
||||||
try:
|
try:
|
||||||
while 1:
|
while 1:
|
||||||
# Clear the screen
|
# Move cursor to the top left corner
|
||||||
print("\033[2J\033[H", end="")
|
print("\033[H", end="")
|
||||||
draw_frame()
|
draw_frame()
|
||||||
frame += speed
|
frame += speed
|
||||||
sleep(frame_delay)
|
sleep(frame_delay)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue