Sanity check when moving baseline for line height adjustment

This commit is contained in:
Kovid Goyal 2017-11-29 08:30:34 +05:30
parent d3e8c616b0
commit 0f2bcfabb3
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C

View File

@ -291,8 +291,8 @@ update_cell_metrics() {
if (cell_height > 1000) { PyErr_SetString(PyExc_ValueError, "line height too large after adjustment"); return NULL; }
underline_position = MIN(cell_height - 1, underline_position);
if (line_height_adjustment > 1) {
baseline += line_height_adjustment / 2;
underline_position += line_height_adjustment / 2;
baseline += MIN(cell_height - 1, (unsigned)line_height_adjustment / 2);
underline_position += MIN(cell_height - 1, (unsigned)line_height_adjustment / 2);
}
sprite_tracker_set_layout(cell_width, cell_height);
global_state.cell_width = cell_width; global_state.cell_height = cell_height;