Merge pull request #24566 from thomasruiz/fix/completion-box-center-text-vertically

Center lines vertically in completion box
This commit is contained in:
Rémi Verschelde 2018-12-27 08:55:17 +01:00 committed by GitHub
commit e86418f7a9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1327,7 +1327,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) {