Преглед на файлове

Rich Text Label: fixed deselection issue

Dmitry Koteroff преди 7 години
родител
ревизия
0a1a5396ec
променени са 1 файла, в които са добавени 11 реда и са изтрити 0 реда
  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();
+							}
 						}
 					}