Skip to content

Commit

Permalink
Fixed rightward drift
Browse files Browse the repository at this point in the history
  • Loading branch information
Vrajs16 authored and chris-laplante committed Jul 31, 2023
1 parent bfc8bcb commit 0624348
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions src/state.rs
Expand Up @@ -162,16 +162,16 @@ impl BarState {

pub(crate) fn suspend<F: FnOnce() -> R, R>(&mut self, now: Instant, f: F) -> R {
if let Some((state, _)) = self.draw_target.remote() {
state.write().unwrap().suspend(f, now)
} else {
if let Some(drawable) = self.draw_target.drawable(true, now) {
let _ = drawable.clear();
}
return state.write().unwrap().suspend(f, now);
}

let ret = f();
let _ = self.draw(true, Instant::now());
ret
if let Some(drawable) = self.draw_target.drawable(true, now) {
let _ = drawable.clear();
}

let ret = f();
let _ = self.draw(true, Instant::now());
ret
}

pub(crate) fn draw(&mut self, mut force_draw: bool, now: Instant) -> io::Result<()> {
Expand Down

0 comments on commit 0624348

Please sign in to comment.