From d3f94b4acccbdb1c3db67610f032473dcd4c2b30 Mon Sep 17 00:00:00 2001 From: electria Date: Sun, 16 Aug 2026 20:34:21 -0700 Subject: [PATCH] fix: improve anti-clipping for graphs --- src/app/graph.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/app/graph.rs b/src/app/graph.rs index 5b93a80..f370cfa 100644 --- a/src/app/graph.rs +++ b/src/app/graph.rs @@ -55,7 +55,8 @@ impl canvas::Program for Graph { &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 y = bounds.height - value / 100. * bounds.height - 1.; + let y = (bounds.height - value / 100. * bounds.height) + .clamp(1., bounds.height - 1.); builder.line_to(Point::new(x, y)) } }),