From 1b814f968862804d13da999a3c8beef80164129c Mon Sep 17 00:00:00 2001 From: electria Date: Mon, 9 Nov 2026 17:10:59 -0800 Subject: [PATCH] fix: fill screen horizontally before, the line graph would always be one step behind (left) --- src/app/graph.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/app/graph.rs b/src/app/graph.rs index 8a3796a..79a96b7 100644 --- a/src/app/graph.rs +++ b/src/app/graph.rs @@ -35,7 +35,7 @@ impl canvas::Program for Graph { frame.stroke( &canvas::Path::new(|builder| { for (index, value) in self.timeline.iter().enumerate() { - let x = index as f32 / self.timeline.len() as f32 * bounds.width; + let x = index as f32 / (self.timeline.len() - 1) as f32 * bounds.width; let y = bounds.height - value / 100. * bounds.height; builder.line_to(Point::new(x, y)) }