diff options
author | Thomas Ruiz <contact@thomasruiz.eu> | 2018-12-23 12:19:27 +0100 |
---|---|---|
committer | Thomas Ruiz <contact@thomasruiz.eu> | 2018-12-23 12:19:27 +0100 |
commit | 7fb0853c68acd7d4f2709c11f01a0ddac1545876 (patch) | |
tree | c2be2de06a497ccf1b6e35015955cd3a6d4ec423 /scene/gui/text_edit.cpp | |
parent | 10e9221c49eddc05cb36c0b582060cac9e4c8cef (diff) |
Center lines vertically in completion box
Diffstat (limited to 'scene/gui/text_edit.cpp')
-rw-r--r-- | scene/gui/text_edit.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/scene/gui/text_edit.cpp b/scene/gui/text_edit.cpp index b1849b7e69..43a4f772b7 100644 --- a/scene/gui/text_edit.cpp +++ b/scene/gui/text_edit.cpp @@ -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) { |