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)) } }),