diff --git a/draw/src/stacked.rs b/draw/src/stacked.rs index b94d41a..ae3fe34 100644 --- a/draw/src/stacked.rs +++ b/draw/src/stacked.rs @@ -79,8 +79,8 @@ fn draw_scaled_graph(image: &mut RgbImage, graph: &StackedSeries) { let color = colors[series_idx]; let height_px = (graph.config.height_px as f32) * sample * scale; if height_px > 1f32 { - let rect = Rect::at(x_offset as i32, (y_offset - height_px) as i32) - .of_size(graph.config.width_px_per_sample, height_px as u32); + let rect = Rect::at(x_offset as i32, (y_offset - height_px).ceil() as i32) + .of_size(graph.config.width_px_per_sample, height_px.ceil() as u32); draw_filled_rect_mut(image, rect, color); y_offset -= height_px; }