summaryrefslogtreecommitdiff
path: root/scene/gui
diff options
context:
space:
mode:
authorRĂ©mi Verschelde <rverschelde@gmail.com>2017-12-07 07:38:26 +0100
committerGitHub <noreply@github.com>2017-12-07 07:38:26 +0100
commitf13bea768d2b22f3e49b355454d09fcf8ec97e72 (patch)
tree7ca675fc03fdc87f053bbd6be96decb9af581e08 /scene/gui
parent3ce41b81e59c3fa5e3b9d7a5fa78d13bf3746dd8 (diff)
parentde03966a650621635c5a9e78f54a710a675fbe6b (diff)
Merge pull request #14353 from TheAspiringHacker/fix-lineedit-eat
Check for icon in LineEdit::set_cursor_position
Diffstat (limited to 'scene/gui')
-rw-r--r--scene/gui/line_edit.cpp4
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;