Skip to content

Commit

Permalink
Merge pull request #92565 from bruvzg/rtl_clear_flags
Browse files Browse the repository at this point in the history
[RTL] Clear default justification flags if custom are set.
  • Loading branch information
akien-mga committed May 30, 2024
2 parents 7ba29c0 + 3a52e0f commit 505da68
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion scene/gui/rich_text_label.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4538,6 +4538,7 @@ void RichTextLabel::append_text(const String &p_bbcode) {
if (subtag_a.size() == 2) {
if (subtag_a[0] == "justification_flags" || subtag_a[0] == "jst") {
Vector<String> subtag_b = subtag_a[1].split(",");
jst_flags = 0; // Clear flags.
for (const String &E : subtag_b) {
if (E == "kashida" || E == "k") {
jst_flags.set_flag(TextServer::JUSTIFICATION_KASHIDA);
Expand All @@ -4551,7 +4552,7 @@ void RichTextLabel::append_text(const String &p_bbcode) {
jst_flags.set_flag(TextServer::JUSTIFICATION_SKIP_LAST_LINE);
} else if (E == "skip_last_with_chars" || E == "sv") {
jst_flags.set_flag(TextServer::JUSTIFICATION_SKIP_LAST_LINE_WITH_VISIBLE_CHARS);
} else if (E == "do_not_skip_singe" || E == "ns") {
} else if (E == "do_not_skip_single" || E == "ns") {
jst_flags.set_flag(TextServer::JUSTIFICATION_DO_NOT_SKIP_SINGLE_LINE);
}
}
Expand Down

0 comments on commit 505da68

Please sign in to comment.