diff options
author | Kirill Chibisov <contact@kchibisov.com> | 2022-03-06 19:34:12 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-03-06 19:34:12 +0300 |
commit | dbccd7e30f40d9a7485c7537b415473ffc09b3d3 (patch) | |
tree | 1e48c72a028e503b28465d64a6e477413ed90bc0 | |
parent | d8113dc2b649f5e5b14fa26a08d13968bfa8c096 (diff) | |
download | alacritty-dbccd7e30f40d9a7485c7537b415473ffc09b3d3.tar.gz alacritty-dbccd7e30f40d9a7485c7537b415473ffc09b3d3.zip |
Use round instead of ceil for line position
Ceiling line position results in strikeout line being lower than
it should.
-rw-r--r-- | alacritty/res/rect.f.glsl | 2 | ||||
-rw-r--r-- | alacritty/src/renderer/rects.rs | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/alacritty/res/rect.f.glsl b/alacritty/res/rect.f.glsl index 0e0a2616..4fbbd874 100644 --- a/alacritty/res/rect.f.glsl +++ b/alacritty/res/rect.f.glsl @@ -87,7 +87,7 @@ color_t draw_dotted(float_t x, float_t y) { // Since we use the entire descent area for dotted underlines, we limit its // height to a single pixel so we don't draw bars instead of dots. - float_t alpha = 1. - abs(floor(underlinePosition - 0.5) - y); + float_t alpha = 1. - abs(floor(underlinePosition) - y); if (int(mod(x, 2.)) != int(cellEven)) { alpha = 0.; } diff --git a/alacritty/src/renderer/rects.rs b/alacritty/src/renderer/rects.rs index 8c600b6b..a4a6bf5d 100644 --- a/alacritty/src/renderer/rects.rs +++ b/alacritty/src/renderer/rects.rs @@ -137,7 +137,7 @@ impl RenderLine { let line_bottom = (start.line as f32 + 1.) * size.cell_height(); let baseline = line_bottom + descent; - let mut y = (baseline - position - thickness / 2.).ceil(); + let mut y = (baseline - position - thickness / 2.).round(); let max_y = line_bottom - thickness; if y > max_y { y = max_y; |