Skip to content

Commit 5665f6a

Browse files
committed
Fix the flickering issue
1 parent 0b1c448 commit 5665f6a

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

src/app.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,8 @@ use rayon::iter::{IntoParallelRefIterator, ParallelIterator};
2525
use rayon::slice::ParallelSliceMut;
2626

2727
use std::cmp::min;
28-
use std::fs;
2928
use std::time::Duration;
29+
use std::{fs, thread};
3030

3131
pub const WINDOW_WIDTH: f32 = 500.;
3232
pub const DEFAULT_WINDOW_HEIGHT: f32 = 65.;
@@ -282,6 +282,7 @@ impl Tile {
282282
let max_elem = min(5, new_length);
283283

284284
if prev_size != new_length {
285+
thread::sleep(Duration::from_millis(30));
285286
window::resize(
286287
id,
287288
iced::Size {

0 commit comments

Comments
 (0)