box-drawing: LIGHT ARC: improve symmetry when cell width is even

This commit is contained in:
Daniel Eklöf 2021-01-01 13:18:51 +01:00
parent 167078c076
commit 848bd27dd5
No known key found for this signature in database
GPG key ID: 5BBD4992C116573F

View file

@ -1066,9 +1066,9 @@ draw_box_drawings_light_arc(wchar_t wc, uint8_t *buf, int width, int height, int
if (wc == L'') {
start_x = hw;
start_y = height - 1;
start_y = 2 * hh;
end_x = width - 1;
end_x = 2 * hw;
end_y = hh;
c1_x = hw;
@ -1078,7 +1078,7 @@ draw_box_drawings_light_arc(wchar_t wc, uint8_t *buf, int width, int height, int
c2_y = hh;
} else if (wc == L'') {
start_x = hw;
start_y = height - 1;
start_y = 2 * hh;
end_x = 0;
end_y = hh;
@ -1106,7 +1106,7 @@ draw_box_drawings_light_arc(wchar_t wc, uint8_t *buf, int width, int height, int
start_x = hw;
start_y = 0;
end_x = width - 1;
end_x = 2 * hw;
end_y = hh;
c1_x = hw;
@ -1131,6 +1131,26 @@ draw_box_drawings_light_arc(wchar_t wc, uint8_t *buf, int width, int height, int
}
}
}
if (wc == L'' || wc == L'') {
for (int x = 2 * hw; x < width; x++) {
for (int y = max(hh - delta, 0); y < min(hh + delta + extra, height); y++) {
size_t ofs = x / 8;
size_t bit_no = x % 8;
buf[y * stride + ofs] |= 1 << bit_no;
}
}
}
if (wc == L'' || wc == L'') {
for (int y = 2 * hh; y < height; y++) {
for (int x = max(hw - delta, 0); x < min(hw + delta + extra, width); x++) {
size_t ofs = x / 8;
size_t bit_no = x % 8;
buf[y * stride + ofs] |= 1 << bit_no;
}
}
}
}
static void