Browse Source

Merge pull request #13964 from Krakean/richtextlabel_fix_deselection_bug

Rich Text Label: fixed deselection issue
Rémi Verschelde 7 years ago
parent
commit
7c0de08d38
1 changed files with 11 additions and 0 deletions
  1. 11 0
      scene/gui/rich_text_label.cpp

+ 11 - 0
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();
+							}
 						}
 					}