summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYuri Sizov <11782833+YuriSizov@users.noreply.github.com>2022-12-23 00:10:53 +0300
committerGitHub <noreply@github.com>2022-12-23 00:10:53 +0300
commitecc5c275f45f455f944ba0e4171c1ed9c930f1a7 (patch)
treedd1134a784c707b8e5108ef90f5646b3d5525517
parentc547c4ef5908b9d591497e40217200ecb12e0ebd (diff)
parent81343ae21047a3f989809dffef270c841de0a26d (diff)
Merge pull request #70407 from Koyper/rich_text_bold_italics
[RTL] Fix push bold or italics not using bold_italics_font when required
-rw-r--r--scene/gui/rich_text_label.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/scene/gui/rich_text_label.cpp b/scene/gui/rich_text_label.cpp
index 024c5f8ecf..d5c4fd3f07 100644
--- a/scene/gui/rich_text_label.cpp
+++ b/scene/gui/rich_text_label.cpp
@@ -3182,7 +3182,8 @@ void RichTextLabel::push_normal() {
void RichTextLabel::push_bold() {
ERR_FAIL_COND(theme_cache.bold_font.is_null());
- _push_def_font(BOLD_FONT);
+ ItemFont *item_font = _find_font(current);
+ _push_def_font((item_font && item_font->def_font == ITALICS_FONT) ? BOLD_ITALICS_FONT : BOLD_FONT);
}
void RichTextLabel::push_bold_italics() {
@@ -3194,7 +3195,8 @@ void RichTextLabel::push_bold_italics() {
void RichTextLabel::push_italics() {
ERR_FAIL_COND(theme_cache.italics_font.is_null());
- _push_def_font(ITALICS_FONT);
+ ItemFont *item_font = _find_font(current);
+ _push_def_font((item_font && item_font->def_font == BOLD_FONT) ? BOLD_ITALICS_FONT : ITALICS_FONT);
}
void RichTextLabel::push_mono() {