summaryrefslogtreecommitdiff
path: root/scene/gui
diff options
context:
space:
mode:
authorRĂ©mi Verschelde <rverschelde@gmail.com>2017-12-10 16:17:54 +0100
committerGitHub <noreply@github.com>2017-12-10 16:17:54 +0100
commit523237943cff1bb1b2b5e85289bb89455856437a (patch)
treede4396ffd36c61f59f7e8d97077c8ac1afb16e52 /scene/gui
parent6b6f94fb0c4a23b27295d84c43e219ed721f4d06 (diff)
parent658fb0a0a9b27d93bfccc17f24e55726ec69b293 (diff)
Merge pull request #14509 from poke1024/fix_selection_copy_crash
Fix crash in RichTextLabel::selection_copy()
Diffstat (limited to 'scene/gui')
-rw-r--r--scene/gui/rich_text_label.cpp2
-rw-r--r--scene/gui/rich_text_label.h4
2 files changed, 3 insertions, 3 deletions
diff --git a/scene/gui/rich_text_label.cpp b/scene/gui/rich_text_label.cpp
index 9cf4c105b4..45188c3a52 100644
--- a/scene/gui/rich_text_label.cpp
+++ b/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;
diff --git a/scene/gui/rich_text_label.h b/scene/gui/rich_text_label.h
index 1096e3f650..b9a719dd10 100644
--- a/scene/gui/rich_text_label.h
+++ b/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;