diff options
| author | TheAspiringHacker <TheAspiringHacker@protonmail.com> | 2017-12-06 19:13:34 -0500 |
|---|---|---|
| committer | TheAspiringHacker <TheAspiringHacker@protonmail.com> | 2017-12-06 19:13:34 -0500 |
| commit | de03966a650621635c5a9e78f54a710a675fbe6b (patch) | |
| tree | 587af710bc4929b7889e309ccd4f8aca097daa80 /scene | |
| parent | f6b69dbe8297780717d575d260c8148ea2fa5b32 (diff) | |
| download | redot-engine-de03966a650621635c5a9e78f54a710a675fbe6b.tar.gz | |
Check for icon in LineEdit::set_cursor_position
Fixes #14340
Diffstat (limited to 'scene')
| -rw-r--r-- | scene/gui/line_edit.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/scene/gui/line_edit.cpp b/scene/gui/line_edit.cpp index f7bf1cd9ea..85ae6d6241 100644 --- a/scene/gui/line_edit.cpp +++ b/scene/gui/line_edit.cpp @@ -1046,6 +1046,10 @@ void LineEdit::set_cursor_position(int p_pos) { } else if (cursor_pos > window_pos) { /* Adjust window if cursor goes too much to the right */ int window_width = get_size().width - style->get_minimum_size().width; + if (has_icon("right_icon")) { + Ref<Texture> r_icon = Control::get_icon("right_icon"); + window_width -= r_icon->get_width(); + } if (window_width < 0) return; |
