diff options
author | Yuri Sizov <yuris@humnom.net> | 2022-12-21 19:29:12 +0300 |
---|---|---|
committer | Yuri Sizov <yuris@humnom.net> | 2022-12-21 19:29:12 +0300 |
commit | b67a938caaa8fe87496ed076d6871549dfc801d8 (patch) | |
tree | 4151724d4b22286801ee83317c9ea37c28712cb2 /scene/theme | |
parent | 63f95c0e58e51ec2939e8b47803cb607fb35cadc (diff) |
Add fallback values for font and scale to the default theme
Diffstat (limited to 'scene/theme')
-rw-r--r-- | scene/theme/theme_db.cpp | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/scene/theme/theme_db.cpp b/scene/theme/theme_db.cpp index 0268a685fe..ae64313741 100644 --- a/scene/theme/theme_db.cpp +++ b/scene/theme/theme_db.cpp @@ -70,7 +70,9 @@ void ThemeDB::initialize_theme() { Ref<Font> font; if (!font_path.is_empty()) { font = ResourceLoader::load(font_path); - if (!font.is_valid()) { + if (font.is_valid()) { + set_fallback_font(font); + } else { ERR_PRINT("Error loading custom font '" + font_path + "'"); } } @@ -84,9 +86,6 @@ void ThemeDB::initialize_theme() { Ref<Theme> theme = ResourceLoader::load(theme_path); if (theme.is_valid()) { set_project_theme(theme); - if (font.is_valid()) { - set_fallback_font(font); - } } else { ERR_PRINT("Error loading custom theme '" + theme_path + "'"); } |