diff options
author | Rémi Verschelde <rverschelde@gmail.com> | 2022-10-05 08:32:57 +0200 |
---|---|---|
committer | Rémi Verschelde <rverschelde@gmail.com> | 2022-10-05 08:32:57 +0200 |
commit | b90478924213f62cbfb05ba998c1267367b35ddb (patch) | |
tree | ffab10c01e8b372a1dd63532150f42d31d474bd6 | |
parent | ebbfc9695c6ff313df7ed2bd2e297b1ed4644a2c (diff) | |
parent | 52435e6f90be3753b365ec48a032900f0ccdd94d (diff) |
Merge pull request #66894 from KoBeWi/TileSetAtlasSourceEditor_on_vacation
Disconnect TileSet from source editor if no sources
-rw-r--r-- | editor/plugins/tiles/tile_set_atlas_source_editor.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/editor/plugins/tiles/tile_set_atlas_source_editor.cpp b/editor/plugins/tiles/tile_set_atlas_source_editor.cpp index 45b2a5eb14..4299ae8d3e 100644 --- a/editor/plugins/tiles/tile_set_atlas_source_editor.cpp +++ b/editor/plugins/tiles/tile_set_atlas_source_editor.cpp @@ -2043,6 +2043,13 @@ void TileSetAtlasSourceEditor::_tile_alternatives_control_unscaled_draw() { } void TileSetAtlasSourceEditor::_tile_set_changed() { + if (tile_set->get_source_count() == 0) { + // No sources, so nothing to do here anymore. + tile_set->disconnect("changed", callable_mp(this, &TileSetAtlasSourceEditor::_tile_set_changed)); + tile_set = Ref<TileSet>(); + return; + } + tile_set_changed_needs_update = true; } |