From f8cfd962f3473fee2f617e064147135e7e2d80b3 Mon Sep 17 00:00:00 2001 From: Matthew Toohey Date: Fri, 28 Feb 2025 04:00:08 -0500 Subject: [PATCH] fix: prevent graph lines from showing up behind legend (#1683) * fix: prevent graph lines from showing up behind legend * use cell_mut instead --- src/canvas/components/time_graph/time_chart.rs | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/canvas/components/time_graph/time_chart.rs b/src/canvas/components/time_graph/time_chart.rs index 69af0e81..d7bcc99f 100644 --- a/src/canvas/components/time_graph/time_chart.rs +++ b/src/canvas/components/time_graph/time_chart.rs @@ -872,10 +872,15 @@ impl Widget for TimeChart<'_> { if let Some(legend_area) = layout.legend_area { buf.set_style(legend_area, original_style); - Block::default() + let block = Block::default() .borders(Borders::ALL) - .border_style(self.legend_style) - .render(legend_area, buf); + .border_style(self.legend_style); + for pos in block.inner(legend_area).positions() { + if let Some(cell) = buf.cell_mut(pos) { + cell.set_symbol(" "); + } + } + block.render(legend_area, buf); for (i, (dataset_name, dataset_style)) in self .datasets