Skip to content

Commit 0624348

Browse files
Vrajs16chris-laplante
authored andcommitted
Fixed rightward drift
1 parent bfc8bcb commit 0624348

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

src/state.rs

+8-8
Original file line numberDiff line numberDiff line change
@@ -162,16 +162,16 @@ impl BarState {
162162

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

171-
let ret = f();
172-
let _ = self.draw(true, Instant::now());
173-
ret
168+
if let Some(drawable) = self.draw_target.drawable(true, now) {
169+
let _ = drawable.clear();
174170
}
171+
172+
let ret = f();
173+
let _ = self.draw(true, Instant::now());
174+
ret
175175
}
176176

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

0 commit comments

Comments
 (0)