This commit is contained in:
Kovid Goyal 2022-07-26 20:27:59 +05:30
commit 6b2337c9c0
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C

View File

@ -393,7 +393,8 @@ calc_cell_metrics(FontGroup *fg) {
underline_position = MIN(cell_height - 1, underline_position);
// ensure there is at least a couple of pixels available to render styled underlines
// there should be at least one pixel on either side of the underline_position
while (underline_position > baseline + 1 && cell_height - underline_position < 1) underline_position--;
if (underline_position > baseline + 1 && underline_position > cell_height - 1)
underline_position = MAX(baseline + 1, cell_height - 1);
if (line_height_adjustment > 1) {
baseline += MIN(cell_height - 1, (unsigned)line_height_adjustment / 2);
underline_position += MIN(cell_height - 1, (unsigned)line_height_adjustment / 2);