summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRémi Verschelde <rverschelde@gmail.com>2021-01-08 09:18:12 +0100
committerRémi Verschelde <rverschelde@gmail.com>2021-01-08 09:18:19 +0100
commit50f73143291f564afd784a70bdd3bbcf1efc62f6 (patch)
treef20da7c6c7a9b25b43252ac37aa629cf707ff9e2
parent9349a5507f56024131c278e29080a891e54f5933 (diff)
RichTextLabel: Fix build after #35505
Should have rebased before merging.
-rw-r--r--scene/gui/rich_text_label.cpp13
1 files changed, 7 insertions, 6 deletions
diff --git a/scene/gui/rich_text_label.cpp b/scene/gui/rich_text_label.cpp
index 7e53a5623f..a1aa72b29a 100644
--- a/scene/gui/rich_text_label.cpp
+++ b/scene/gui/rich_text_label.cpp
@@ -2865,17 +2865,18 @@ Error RichTextLabel::append_bbcode(const String &p_bbcode) {
}
}
push_cell();
+ const Color fallback_color = Color(0, 0, 0, 0);
for (int i = 0; i < subtag.size(); i++) {
Vector<String> subtag_a = subtag[i].split("=");
if (subtag_a.size() == 2) {
if (subtag_a[0] == "border") {
- Color color = _get_color_from_string(subtag_a[1], Color(0, 0, 0, 0));
+ Color color = Color::from_string(subtag_a[1], fallback_color);
set_cell_border_color(color);
} else if (subtag_a[0] == "bg") {
Vector<String> subtag_b = subtag_a[1].split(",");
if (subtag_b.size() == 2) {
- Color color1 = _get_color_from_string(subtag_b[0], Color(0, 0, 0, 0));
- Color color2 = _get_color_from_string(subtag_b[1], Color(0, 0, 0, 0));
+ Color color1 = Color::from_string(subtag_b[0], fallback_color);
+ Color color2 = Color::from_string(subtag_b[1], fallback_color);
set_cell_row_background_color(color1, color2);
}
}
@@ -3091,9 +3092,9 @@ Error RichTextLabel::append_bbcode(const String &p_bbcode) {
} else if (subtag_a[0] == "outline_size") {
outline_size = subtag_a[1].to_int();
} else if (subtag_a[0] == "color") {
- color = _get_color_from_string(subtag_a[1], color);
+ color = Color::from_string(subtag_a[1], color);
} else if (subtag_a[0] == "outline_color") {
- outline_color = _get_color_from_string(subtag_a[1], outline_color);
+ outline_color = Color::from_string(subtag_a[1], outline_color);
}
}
}
@@ -3172,7 +3173,7 @@ Error RichTextLabel::append_bbcode(const String &p_bbcode) {
} else if (tag.begins_with("outline_color=")) {
String color_str = tag.substr(14, tag.length());
- Color color = _get_color_from_string(color_str, base_color);
+ Color color = Color::from_string(color_str, base_color);
push_outline_color(color);
pos = brk_end + 1;
tag_stack.push_front("outline_color");