diff options
author | Rémi Verschelde <rverschelde@gmail.com> | 2018-12-27 08:55:17 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-12-27 08:55:17 +0100 |
commit | e86418f7a92a498208c325446c9d7f654c48f359 (patch) | |
tree | 94401fcc4e81cb6df8ebee4b43fb148f78569acc | |
parent | a1fa614e78643832a37fa436ae4c3012bbc819df (diff) | |
parent | 7fb0853c68acd7d4f2709c11f01a0ddac1545876 (diff) |
Merge pull request #24566 from thomasruiz/fix/completion-box-center-text-vertically
Center lines vertically in completion box
-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 c9efca0a29..003b30e035 100644 --- a/scene/gui/text_edit.cpp +++ b/scene/gui/text_edit.cpp @@ -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) { |