Fix gap calculation for dashed underline

This commit is contained in:
Kirill Chibisov 2022-03-02 22:35:19 +03:00 committed by GitHub
parent 1880522b64
commit d8113dc2b6
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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.;
}