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.
This commit is contained in:
Lunatoid 2020-08-21 19:21:17 +02:00
parent 071d359f42
commit 740100d671

View file

@ -218,8 +218,15 @@ void editor_register_and_generate_icons(Ref<Theme> p_theme, bool p_dark_theme =
// Generate icons. // Generate icons.
if (!p_only_thumbs) { if (!p_only_thumbs) {
for (int i = 0; i < editor_icons_count; i++) { 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 int is_exception = exceptions.has(editor_icons_names[i]);
const Ref<ImageTexture> icon = editor_generate_icon(i, !is_exception); const Ref<ImageTexture> icon = editor_generate_icon(i, !is_exception, icon_scale);
p_theme->set_icon(editor_icons_names[i], "EditorIcons", icon); p_theme->set_icon(editor_icons_names[i], "EditorIcons", icon);
} }