Skip to content

Commit

Permalink
Fix gap calculation for dashed underline
Browse files Browse the repository at this point in the history
  • Loading branch information
kchibisov committed Mar 2, 2022
1 parent 1880522 commit d8113dc
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions alacritty/res/rect.f.glsl
Original file line number Diff line number Diff line change
Expand Up @@ -98,12 +98,12 @@ color_t draw_dotted(float_t x, float_t y) {
color_t draw_dashed(float_t x) {
// Since dashes of adjacent cells connect with each other our dash length is
// half of the desired total length.
float_t halfDashLen = floor(cellWidth / 4.);
float_t halfDashLen = floor(cellWidth / 4. + 0.5);

float_t alpha = 1.;

// Check if `x` coordinate is where we should draw gap.
if (x > halfDashLen && x < cellWidth - halfDashLen - 1.) {
if (x > halfDashLen - 1. && x < cellWidth - halfDashLen) {
alpha = 0.;
}

Expand Down

0 comments on commit d8113dc

Please sign in to comment.