summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRémi Verschelde <rverschelde@gmail.com>2017-12-05 09:23:40 +0100
committerGitHub <noreply@github.com>2017-12-05 09:23:40 +0100
commit7c0de08d386222cb7074c9406047b728ed0e2701 (patch)
treeb63c878aa2933e62693d63b70d73a4d330cd0176
parentc7f9d8a059947d9da383b6b8c06c82bbfe747550 (diff)
parent0a1a5396ec4681f86daa3c2565cf91cc2a699fad (diff)
Merge pull request #13964 from Krakean/richtextlabel_fix_deselection_bug
Rich Text Label: fixed deselection issue
-rw-r--r--scene/gui/rich_text_label.cpp11
1 files changed, 11 insertions, 0 deletions
diff --git a/scene/gui/rich_text_label.cpp b/scene/gui/rich_text_label.cpp
index 124c268c8a..9cf4c105b4 100644
--- a/scene/gui/rich_text_label.cpp
+++ b/scene/gui/rich_text_label.cpp
@@ -793,6 +793,17 @@ void RichTextLabel::_gui_input(Ref<InputEvent> p_event) {
selection.click = item;
selection.click_char = line;
+
+ // Erase previous selection.
+ if (selection.active) {
+ selection.from = NULL;
+ selection.from_char = NULL;
+ selection.to = NULL;
+ selection.to_char = NULL;
+ selection.active = false;
+
+ update();
+ }
}
}