mirror of
https://github.com/kovidgoyal/kitty.git
synced 2026-10-20 20:22:10 +00:00
CoreText: Fix incorrect underline position and thickness calculation
This commit is contained in:
parent
da0309545e
commit
872118fcbe
1 changed files with 2 additions and 2 deletions
|
|
@ -247,8 +247,8 @@ cell_metrics(PyObject *s, unsigned int* cell_width, unsigned int* cell_height, u
|
|||
*cell_width = MAX(1, width);
|
||||
float line_height = MAX(1, floor(self->ascent + self->descent + MAX(0, self->leading) + 0.5));
|
||||
*cell_height = (unsigned int)line_height;
|
||||
*underline_position = (unsigned int)self->underline_position;
|
||||
*underline_thickness = (unsigned int)self->underline_thickness;
|
||||
*underline_position = floor(self->ascent - self->underline_position + 0.5);
|
||||
*underline_thickness = (unsigned int)ceil(MAX(0.1, self->underline_thickness));
|
||||
*baseline = (unsigned int)self->ascent;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue