summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKoyper <tim@maffle.com>2022-11-24 10:16:33 -0600
committerKoyper <tim@maffle.com>2022-12-22 13:30:52 -0600
commit81343ae21047a3f989809dffef270c841de0a26d (patch)
tree6742dc00acae248416dc53b179c556beb835a724
parent63f95c0e58e51ec2939e8b47803cb607fb35cadc (diff)
Fixed RichTextLabel push bold/italic to correctly use bold_italic font.
-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 a0f2096009..bb329f8817 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() {