diff options
| author | Ruslan Mustakov | 2018-03-17 15:44:34 +0700 |
|---|---|---|
| committer | Ruslan Mustakov | 2018-05-08 13:45:24 +0700 |
| commit | 5cd12f6649387f91d08fd17bf3c70e732798ab58 (patch) | |
| tree | cc0e4fd2ce69997c67df9aa36b7390cb52c0534c /scene/gui/line_edit.cpp | |
| parent | 6e8e401359ba86d33253fb3d3241cf09a742c8e4 (diff) | |
| download | godot-5cd12f6649387f91d08fd17bf3c70e732798ab58.tar.gz godot-5cd12f6649387f91d08fd17bf3c70e732798ab58.tar.zst godot-5cd12f6649387f91d08fd17bf3c70e732798ab58.zip | |
Diffstat (limited to 'scene/gui/line_edit.cpp')
| -rw-r--r-- | scene/gui/line_edit.cpp | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/scene/gui/line_edit.cpp b/scene/gui/line_edit.cpp index 1ceb3f0a8..e57af0a4c 100644 --- a/scene/gui/line_edit.cpp +++ b/scene/gui/line_edit.cpp @@ -656,6 +656,7 @@ void LineEdit::_notification(int p_what) { } int caret_height = font->get_height() > y_area ? y_area : font->get_height(); + FontDrawer drawer(font, Color(1, 1, 1)); while (true) { //end of string, break! @@ -683,7 +684,7 @@ void LineEdit::_notification(int p_what) { VisualServer::get_singleton()->canvas_item_add_rect(ci, Rect2(Point2(x_ofs, y_ofs + caret_height), Size2(im_char_width, 1)), font_color); } - font->draw_char(ci, Point2(x_ofs, y_ofs + font_ascent), cchar, next, font_color); + drawer.draw_char(ci, Point2(x_ofs, y_ofs + font_ascent), cchar, next, font_color); x_ofs += im_char_width; ofs++; @@ -704,7 +705,7 @@ void LineEdit::_notification(int p_what) { if (selected) VisualServer::get_singleton()->canvas_item_add_rect(ci, Rect2(Point2(x_ofs, y_ofs), Size2(char_width, caret_height)), selection_color); - font->draw_char(ci, Point2(x_ofs, y_ofs + font_ascent), cchar, next, selected ? font_color_selected : font_color); + drawer.draw_char(ci, Point2(x_ofs, y_ofs + font_ascent), cchar, next, selected ? font_color_selected : font_color); if (char_ofs == cursor_pos && draw_caret) { if (ime_text.length() == 0) { @@ -737,7 +738,7 @@ void LineEdit::_notification(int p_what) { VisualServer::get_singleton()->canvas_item_add_rect(ci, Rect2(Point2(x_ofs, y_ofs + caret_height), Size2(im_char_width, 1)), font_color); } - font->draw_char(ci, Point2(x_ofs, y_ofs + font_ascent), cchar, next, font_color); + drawer.draw_char(ci, Point2(x_ofs, y_ofs + font_ascent), cchar, next, font_color); x_ofs += im_char_width; ofs++; |
