mirror of
https://github.com/alacritty/alacritty.git
synced 2024-11-11 13:51:01 -05:00
Use round instead of ceil for line position
Ceiling line position results in strikeout line being lower than it should.
This commit is contained in:
parent
d8113dc2b6
commit
dbccd7e30f
2 changed files with 2 additions and 2 deletions
|
@ -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
|
// 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.
|
// 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)) {
|
if (int(mod(x, 2.)) != int(cellEven)) {
|
||||||
alpha = 0.;
|
alpha = 0.;
|
||||||
}
|
}
|
||||||
|
|
|
@ -137,7 +137,7 @@ impl RenderLine {
|
||||||
let line_bottom = (start.line as f32 + 1.) * size.cell_height();
|
let line_bottom = (start.line as f32 + 1.) * size.cell_height();
|
||||||
let baseline = line_bottom + descent;
|
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;
|
let max_y = line_bottom - thickness;
|
||||||
if y > max_y {
|
if y > max_y {
|
||||||
y = max_y;
|
y = max_y;
|
||||||
|
|
Loading…
Reference in a new issue