fix: prevent graph lines from showing up behind legend (#1683)

* fix: prevent graph lines from showing up behind legend

* use cell_mut instead
This commit is contained in:
Matthew Toohey 2025-02-28 04:00:08 -05:00 committed by GitHub
parent d2177ed022
commit f8cfd962f3
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -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