From 849dc8757726b063727f4d8e65bc8d8e0fd97c1e Mon Sep 17 00:00:00 2001 From: Lunatoid Date: Fri, 21 Aug 2020 19:21:17 +0200 Subject: [PATCH] Fixes DefaultProjectIcon scaling with editor scale Should fix #27009 where the DefaultProjectIcon was scaling with the EDSCALE. Now it checks if the icon name is equal to "DefaultProjectIcon" and sets the scale to 1.0 instead of EDSCALE. (cherry picked from commit 740100d671f37db47dd15a3b6109225c17a0c4c6) --- editor/editor_themes.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/editor/editor_themes.cpp b/editor/editor_themes.cpp index b73e54e8e20..1caa65b80b6 100644 --- a/editor/editor_themes.cpp +++ b/editor/editor_themes.cpp @@ -226,8 +226,15 @@ void editor_register_and_generate_icons(Ref p_theme, bool p_dark_theme = // Generate icons. if (!p_only_thumbs) { for (int i = 0; i < editor_icons_count; i++) { + float icon_scale = EDSCALE; + + // Always keep the DefaultProjectIcon at the default size + if (strcmp(editor_icons_names[i], "DefaultProjectIcon") == 0) { + icon_scale = 1.0f; + } + const int is_exception = exceptions.has(editor_icons_names[i]); - const Ref icon = editor_generate_icon(i, !is_exception); + const Ref icon = editor_generate_icon(i, !is_exception, icon_scale); p_theme->set_icon(editor_icons_names[i], "EditorIcons", icon); }