mirror of
https://github.com/godotengine/godot.git
synced 2024-11-25 13:43:15 +00:00
Merge pull request #77403 from KoBeWi/RichHackLabel
[3.x] Cache text property when toggling BBCode
This commit is contained in:
commit
450902ad3f
@ -2741,8 +2741,17 @@ void RichTextLabel::set_use_bbcode(bool p_enable) {
|
||||
if (use_bbcode == p_enable) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (p_enable) {
|
||||
cached_text = get_text();
|
||||
}
|
||||
|
||||
use_bbcode = p_enable;
|
||||
set_bbcode(bbcode);
|
||||
|
||||
if (!p_enable) {
|
||||
set_text(cached_text);
|
||||
}
|
||||
property_list_changed_notify();
|
||||
}
|
||||
|
||||
|
@ -408,6 +408,7 @@ private:
|
||||
|
||||
bool use_bbcode;
|
||||
String bbcode;
|
||||
String cached_text;
|
||||
|
||||
int fixed_width;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user