diff options
author | RĂ©mi Verschelde <remi@verschelde.fr> | 2021-09-24 21:42:38 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-09-24 21:42:38 +0200 |
commit | 46cc0af5c509f33b65cc57e45e777b2d2a0a303f (patch) | |
tree | 77235bd9381eabe8bd1733bbb476f5eeb9e92a1a | |
parent | 8b279541b2191e0b4016f52f45b30b48c8c6090c (diff) | |
parent | e70a0d950afa2c832cc7198736593a0555559391 (diff) |
Merge pull request #53009 from Chaosus/fix_completion_results
-rw-r--r-- | scene/gui/code_edit.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/scene/gui/code_edit.cpp b/scene/gui/code_edit.cpp index 5d1106bb41..c7d1d7ef82 100644 --- a/scene/gui/code_edit.cpp +++ b/scene/gui/code_edit.cpp @@ -227,17 +227,17 @@ void CodeEdit::_notification(int p_what) { end = font->get_string_size(line.substr(0, line.rfind(String::chr(0xFFFF))), font_size).x; } - Point2 round_ofs = hint_ofs + sb->get_offset() + Vector2(0, font->get_ascent() + font_height * i + yofs); + Point2 round_ofs = hint_ofs + sb->get_offset() + Vector2(0, font->get_ascent(font_size) + font_height * i + yofs); round_ofs = round_ofs.round(); draw_string(font, round_ofs, line.replace(String::chr(0xFFFF), ""), HALIGN_LEFT, -1, font_size, font_color); if (end > 0) { // Draw an underline for the currently edited function parameter. - const Vector2 b = hint_ofs + sb->get_offset() + Vector2(begin, font_height + font_height * i + line_spacing); + const Vector2 b = hint_ofs + sb->get_offset() + Vector2(begin, font_height + font_height * i + yofs); draw_line(b, b + Vector2(end - begin, 0), font_color, 2); // Draw a translucent text highlight as well. const Rect2 highlight_rect = Rect2( - hint_ofs + sb->get_offset() + Vector2(begin, 0), + b - Vector2(0, font_height), Vector2(end - begin, font_height)); draw_rect(highlight_rect, font_color * Color(1, 1, 1, 0.2)); } |