From 389df16c0ca3275ac90cfeeb1607457fbf49d60e Mon Sep 17 00:00:00 2001 From: Rushmore75 Date: Thu, 29 Jan 2026 13:21:49 -0700 Subject: [PATCH] discard data during pause --- src/main.rs | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/src/main.rs b/src/main.rs index eaeee97..dfeedf7 100644 --- a/src/main.rs +++ b/src/main.rs @@ -316,20 +316,20 @@ async fn main() { // keep track of the delta time since last plot plot_delta_time += frame_delta_time; - if !pause { - match rx.try_recv() { - Ok(x) => { + match rx.try_recv() { + Ok(x) => { + if !pause { graph.place_next(plot_delta_time, 0., x as f32); plot_delta_time = 0.; } - Err(x) => match x { - mpsc::TryRecvError::Empty => {} - mpsc::TryRecvError::Disconnected => { - eprintln!("Sender hung-up."); - return; - } - }, } + Err(x) => match x { + mpsc::TryRecvError::Empty => {} + mpsc::TryRecvError::Disconnected => { + eprintln!("Sender hung-up."); + return; + } + }, } graph.draw();