mirror of
https://github.com/alacritty/alacritty
synced 2024-10-14 11:42:28 +00:00
Fix gap calculation for dashed underline
This commit is contained in:
parent
1880522b64
commit
d8113dc2b6
|
@ -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.;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue