CoreText: Ensure cell_width and cell_height are never zero
This commit is contained in:
parent
77f0328f4f
commit
d25c0d42bc
1 changed files with 3 additions and 2 deletions
|
|
@ -244,8 +244,9 @@
|
|||
if (w > width) width = w;
|
||||
}
|
||||
}
|
||||
*cell_width = width;
|
||||
*cell_height = (unsigned int)floor(self->ascent + self->descent + MAX(0, self->leading) + 0.5);
|
||||
*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;
|
||||
*baseline = (unsigned int)self->ascent;
|
||||
|
|
|
|||
Loading…
Reference in a new issue