Stretch image on resize in asset description dialog

This commit is contained in:
Kirill 2022-07-01 17:17:40 +03:00 committed by GitHub
parent d30a0d223e
commit 924658a849
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 0 deletions

View File

@ -291,12 +291,15 @@ EditorAssetLibraryItemDescription::EditorAssetLibraryItemDescription() {
hbox->add_child(previews_vbox);
previews_vbox->add_theme_constant_override("separation", 15 * EDSCALE);
previews_vbox->set_v_size_flags(Control::SIZE_EXPAND_FILL);
previews_vbox->set_h_size_flags(Control::SIZE_EXPAND_FILL);
preview = memnew(TextureRect);
previews_vbox->add_child(preview);
preview->set_ignore_texture_size(true);
preview->set_stretch_mode(TextureRect::STRETCH_KEEP_ASPECT_CENTERED);
preview->set_custom_minimum_size(Size2(640 * EDSCALE, 345 * EDSCALE));
preview->set_v_size_flags(Control::SIZE_EXPAND_FILL);
preview->set_h_size_flags(Control::SIZE_EXPAND_FILL);
previews_bg = memnew(PanelContainer);
previews_vbox->add_child(previews_bg);