2
0
Эх сурвалжийг харах

Merge pull request #14509 from poke1024/fix_selection_copy_crash

Fix crash in RichTextLabel::selection_copy()
Rémi Verschelde 7 жил өмнө
parent
commit
523237943c

+ 1 - 1
scene/gui/rich_text_label.cpp

@@ -1822,7 +1822,7 @@ bool RichTextLabel::search(const String &p_string, bool p_from_selection) {
 
 void RichTextLabel::selection_copy() {
 
-	if (!selection.enabled)
+	if (!selection.active || !selection.enabled)
 		return;
 
 	String text;

+ 2 - 2
scene/gui/rich_text_label.h

@@ -256,8 +256,8 @@ private:
 		Item *to;
 		int to_char;
 
-		bool active;
-		bool enabled;
+		bool active; // anything selected? i.e. from, to, etc. valid?
+		bool enabled; // allow selections?
 	};
 
 	Selection selection;