diff options
author | Josh Rahm <rahm@google.com> | 2021-09-15 12:13:09 -0600 |
---|---|---|
committer | Josh Rahm <rahm@google.com> | 2021-09-15 12:13:09 -0600 |
commit | 843583e2246a2404999b6c36293d7966cfb84334 (patch) | |
tree | b39bc41b3436cf3e3c849d27623f5c06b11596aa /alacritty | |
parent | 579a59b054b5b994317b58bde1f075b1389f05e7 (diff) | |
download | r-alacritty-843583e2246a2404999b6c36293d7966cfb84334.tar.gz r-alacritty-843583e2246a2404999b6c36293d7966cfb84334.tar.bz2 r-alacritty-843583e2246a2404999b6c36293d7966cfb84334.zip |
Add overline attribute.
Diffstat (limited to 'alacritty')
-rw-r--r-- | alacritty/src/display/content.rs | 2 | ||||
-rw-r--r-- | alacritty/src/renderer/rects.rs | 13 |
2 files changed, 14 insertions, 1 deletions
diff --git a/alacritty/src/display/content.rs b/alacritty/src/display/content.rs index 9f52e74e..e5ff3780 100644 --- a/alacritty/src/display/content.rs +++ b/alacritty/src/display/content.rs @@ -278,7 +278,7 @@ impl RenderableCell { self.bg_alpha == 0. && self.character == ' ' && self.zerowidth.is_none() - && !self.flags.intersects(Flags::UNDERLINE | Flags::STRIKEOUT | Flags::DOUBLE_UNDERLINE | Flags::UNDERCURL) + && !self.flags.intersects(Flags::UNDERLINE | Flags::STRIKEOUT | Flags::DOUBLE_UNDERLINE | Flags::UNDERCURL | Flags::OVERLINE) } /// Apply [`CellRgb`] colors to the cell's colors. diff --git a/alacritty/src/renderer/rects.rs b/alacritty/src/renderer/rects.rs index f4e98bcf..61ff91b7 100644 --- a/alacritty/src/renderer/rects.rs +++ b/alacritty/src/renderer/rects.rs @@ -99,6 +99,18 @@ impl RenderLine { color, )); }, + Flags::OVERLINE => { + let start_x = start.column.0 as f32 * size.cell_width(); + let end_x = (end.column.0 + 1) as f32 * size.cell_width(); + rects.push(RenderRect::new( + start_x + size.padding_x(), + start.line as f32 * size.cell_height(), + end_x - start_x, + metrics.underline_thickness, + color, + 1., + )); + }, Flags::STRIKEOUT => { rects.push(Self::create_rect( size, @@ -235,6 +247,7 @@ impl RenderLines { self.update_flag(cell, Flags::DOUBLE_UNDERLINE); self.update_flag(cell, Flags::STRIKEOUT); self.update_flag(cell, Flags::UNDERCURL); + self.update_flag(cell, Flags::OVERLINE); } /// Update the lines for a specific flag. |