diff options
author | RĂ©mi Verschelde <remi@verschelde.fr> | 2022-07-26 18:27:05 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-07-26 18:27:05 +0200 |
commit | 222e489dfdafedff2f003142e268611ff12c0643 (patch) | |
tree | 13080098f8117c51cd5da550c542acab3dd7fb71 /editor/plugins | |
parent | 835da447dabb552a5d558b40d2df3c3c426f3498 (diff) | |
parent | 8da2710911572504d961194841e5f810cd84c457 (diff) |
Merge pull request #63496 from groud/fix_tile_set_not_saving
Fix TileSet not loading correctly when embedded in a scene
Diffstat (limited to 'editor/plugins')
-rw-r--r-- | editor/plugins/tiles/tiles_editor_plugin.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/editor/plugins/tiles/tiles_editor_plugin.cpp b/editor/plugins/tiles/tiles_editor_plugin.cpp index 419d0ffcfc..97553578ba 100644 --- a/editor/plugins/tiles/tiles_editor_plugin.cpp +++ b/editor/plugins/tiles/tiles_editor_plugin.cpp @@ -226,14 +226,14 @@ void TilesEditorPlugin::synchronize_sources_list(Object *p_current_list, Object } if (item_list->is_visible_in_tree()) { + // Make sure the selection is not overwritten after sorting. + int atlas_sources_lists_current_mem = atlas_sources_lists_current; + item_list->emit_signal(SNAME("sort_request")); + atlas_sources_lists_current = atlas_sources_lists_current_mem; + if (atlas_sources_lists_current < 0 || atlas_sources_lists_current >= item_list->get_item_count()) { item_list->deselect_all(); } else { - // Make sure the selection is not overwritten after sorting. - int atlas_sources_lists_current_mem = atlas_sources_lists_current; - item_list->emit_signal(SNAME("sort_request")); - atlas_sources_lists_current = atlas_sources_lists_current_mem; - item_list->set_current(atlas_sources_lists_current); item_list->ensure_current_is_visible(); item_list->emit_signal(SNAME("item_selected"), atlas_sources_lists_current); |