diff options
author | Stokhos <stokhos@users.noreply.github.com> | 2021-03-28 14:02:12 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-03-28 18:02:12 +0000 |
commit | 974392cdc6fdf1ba0d213145ae578a9316e9d404 (patch) | |
tree | c65dfbdb3641529b1726450607ad4998dc8dfb83 | |
parent | 17923efccfb7e6bbcdeb5f748796d9ee1ea70149 (diff) | |
download | alacritty-974392cdc6fdf1ba0d213145ae578a9316e9d404.tar.gz alacritty-974392cdc6fdf1ba0d213145ae578a9316e9d404.zip |
Fix cursor thickness on wide cells
Fixes #4922.
-rw-r--r-- | CHANGELOG.md | 1 | ||||
-rw-r--r-- | alacritty/src/display/cursor.rs | 4 |
2 files changed, 3 insertions, 2 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md index 710956b4..34f2928e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -23,6 +23,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). - Text selected after search without any match - Incorrect vi cursor position after leaving search - Clicking on URLs on Windows incorrectly opens File Explorer +- Incorrect underline cursor thickness on wide cell ### Removed diff --git a/alacritty/src/display/cursor.rs b/alacritty/src/display/cursor.rs index 0750459d..7cd631e3 100644 --- a/alacritty/src/display/cursor.rs +++ b/alacritty/src/display/cursor.rs @@ -22,12 +22,12 @@ impl IntoRects for RenderableCursor { let mut width = size_info.cell_width(); let height = size_info.cell_height(); + let thickness = (thickness * width as f32).round().max(1.); + if self.is_wide() { width *= 2.; } - let thickness = (thickness * width as f32).round().max(1.); - match self.shape() { CursorShape::Beam => beam(x, y, height, thickness, self.color()), CursorShape::Underline => underline(x, y, width, height, thickness, self.color()), |