summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRémi Verschelde <rverschelde@gmail.com>2019-08-15 18:16:55 +0200
committerGitHub <noreply@github.com>2019-08-15 18:16:55 +0200
commit983e348fe908bbb949f8aed5c8f948ec69275e9c (patch)
treed8beb739012158e72851bcc4d040b631b4072a41
parent97dcdd1a6b3c4e2ecbc32b1244900afb239ed04d (diff)
parent7434966f103812a123811e7fa388692cb606ef88 (diff)
downloadredot-engine-983e348fe908bbb949f8aed5c8f948ec69275e9c.tar.gz
Merge pull request #31387 from Daw11/assets-image-autoselect
Automatically select the first image of the assets page
-rw-r--r--editor/plugins/asset_library_editor_plugin.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/editor/plugins/asset_library_editor_plugin.cpp b/editor/plugins/asset_library_editor_plugin.cpp
index e053a34a4d..132bf3973e 100644
--- a/editor/plugins/asset_library_editor_plugin.cpp
+++ b/editor/plugins/asset_library_editor_plugin.cpp
@@ -270,10 +270,10 @@ void EditorAssetLibraryItemDescription::add_preview(int p_id, bool p_video, cons
if (!p_video) {
preview.image = get_icon("ThumbnailWait", "EditorIcons");
}
- if (preview_images.size() == 0 && !p_video) {
+ preview_images.push_back(preview);
+ if (preview_images.size() == 1 && !p_video) {
_preview_click(p_id);
}
- preview_images.push_back(preview);
}
EditorAssetLibraryItemDescription::EditorAssetLibraryItemDescription() {