Center lines vertically in completion box

This commit is contained in:
Thomas Ruiz 2018-12-23 12:19:27 +01:00
parent 10e9221c49
commit 7fb0853c68
No known key found for this signature in database
GPG key ID: AA1F31A207863EED

View file

@ -1323,7 +1323,8 @@ void TextEdit::_notification(int p_what) {
text_color = color_regions[j].color;
}
}
draw_string(cache.font, Point2(completion_rect.position.x, completion_rect.position.y + i * get_row_height() + cache.font->get_ascent()), completion_options[l], text_color, completion_rect.size.width);
int yofs = (get_row_height() - cache.font->get_height()) / 2;
draw_string(cache.font, Point2(completion_rect.position.x, completion_rect.position.y + i * get_row_height() + cache.font->get_ascent() + yofs), completion_options[l], text_color, completion_rect.size.width);
}
if (scrollw) {