diff options
author | Kirill Chibisov <contact@kchibisov.com> | 2020-04-15 06:50:34 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-04-15 03:50:34 +0000 |
commit | 33abfe34a86863958e70a6b5109eab5740a6bc81 (patch) | |
tree | 7a35c4e477f87a97694c6d2562131a59ab128e05 /alacritty/src/cursor.rs | |
parent | ab2db49af5467ec972e297259dd8c23022783347 (diff) | |
download | r-alacritty-33abfe34a86863958e70a6b5109eab5740a6bc81.tar.gz r-alacritty-33abfe34a86863958e70a6b5109eab5740a6bc81.tar.bz2 r-alacritty-33abfe34a86863958e70a6b5109eab5740a6bc81.zip |
Add config option to set cursor thickness
Fixes #3526.
Diffstat (limited to 'alacritty/src/cursor.rs')
-rw-r--r-- | alacritty/src/cursor.rs | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/alacritty/src/cursor.rs b/alacritty/src/cursor.rs index e18816ed..253fdaa7 100644 --- a/alacritty/src/cursor.rs +++ b/alacritty/src/cursor.rs @@ -20,20 +20,19 @@ use alacritty_terminal::ansi::CursorStyle; use font::{BitmapBuffer, Metrics, RasterizedGlyph}; -/// Width/Height of the cursor relative to the font width -pub const CURSOR_WIDTH_PERCENTAGE: f64 = 0.15; - pub fn get_cursor_glyph( cursor: CursorStyle, metrics: Metrics, offset_x: i8, offset_y: i8, is_wide: bool, + cursor_thickness: f64, ) -> RasterizedGlyph { // Calculate the cell metrics let height = metrics.line_height as i32 + i32::from(offset_y); let mut width = metrics.average_advance as i32 + i32::from(offset_x); - let line_width = cmp::max((f64::from(width) * CURSOR_WIDTH_PERCENTAGE).round() as i32, 1); + + let line_width = cmp::max((cursor_thickness * f64::from(width)).round() as i32, 1); // Double the cursor width if it's above a double-width glyph if is_wide { |