From 4a0648fef5d07bbc58b54f3c898e8f79380b1107 Mon Sep 17 00:00:00 2001 From: Wez Furlong Date: Sat, 10 Feb 2018 21:42:55 -0800 Subject: [PATCH] Add strikethrough rendering --- README.md | 2 +- src/xwin.rs | 10 ++++++++++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 8d397eace..35be5e8d3 100644 --- a/README.md +++ b/README.md @@ -44,8 +44,8 @@ These are in the done/doing soon category: - [x] Paste selection via Shift-Insert (bracketed paste is supported!) - [x] SGR style mouse reporting (works in vim and tmux) - [x] xterm style selection of text with mouse +- [x] Render underline, italic, bold, strikethrough - [ ] Configuration file to specify fonts and colors (in progress) -- [ ] Render underline, italic, bold, strikethrough - [ ] Command line argument parsing instead of launching user shell - [ ] Hyperlinks see: https://gist.github.com/egmontkob/eb114294efbcd5adb1944c9f3cb5feda diff --git a/src/xwin.rs b/src/xwin.rs index 8616fb717..6f9222dd1 100644 --- a/src/xwin.rs +++ b/src/xwin.rs @@ -736,6 +736,16 @@ impl<'a> TerminalWindow<'a> { } } + if attrs.strikethrough() { + self.buffer_image.draw_horizontal_line( + x, + y + (base_y - y) / 2, + cell_print_width * metric_width, + glyph_color.into(), + xgfx::Operator::Over, + ); + } + x += glyph.x_advance; } }