Skip to content

Commit

Permalink
fix: prevent graph lines from showing up behind legend (#1683)
Browse files Browse the repository at this point in the history
* fix: prevent graph lines from showing up behind legend

* use cell_mut instead
  • Loading branch information
mtoohey31 authored Feb 28, 2025
1 parent d2177ed commit f8cfd96
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions src/canvas/components/time_graph/time_chart.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit f8cfd96

Please sign in to comment.