diff options
author | Gilles Roudière <gilles.roudiere@gmail.com> | 2023-02-10 10:46:19 +0100 |
---|---|---|
committer | Gilles Roudière <gilles.roudiere@gmail.com> | 2023-02-10 10:46:19 +0100 |
commit | 89ccdc7d34d7a3973bdccd4a4ca224a1f44eb559 (patch) | |
tree | f7081683b719bcf58d1a9c7b71ec9debe65fec88 /editor/plugins/tiles | |
parent | c4fb119f03477ad9a494ba6cdad211b35a8efcce (diff) |
Fix TileMap patterns creation
Diffstat (limited to 'editor/plugins/tiles')
-rw-r--r-- | editor/plugins/tiles/tile_map_editor.cpp | 2 | ||||
-rw-r--r-- | editor/plugins/tiles/tiles_editor_plugin.cpp | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/editor/plugins/tiles/tile_map_editor.cpp b/editor/plugins/tiles/tile_map_editor.cpp index f0a02a3768..8277e473fd 100644 --- a/editor/plugins/tiles/tile_map_editor.cpp +++ b/editor/plugins/tiles/tile_map_editor.cpp @@ -1277,7 +1277,7 @@ void TileMapEditorTilesPlugin::_stop_dragging() { tile_map->set_cell(tile_map_layer, kv.key, kv.value.source_id, kv.value.get_atlas_coords(), kv.value.alternative_tile); } - if (EditorNode::get_singleton()->is_resource_read_only(tile_set)) { + if (!EditorNode::get_singleton()->is_resource_read_only(tile_set)) { // Creating a pattern in the pattern list. select_last_pattern = true; int new_pattern_index = tile_set->get_patterns_count(); diff --git a/editor/plugins/tiles/tiles_editor_plugin.cpp b/editor/plugins/tiles/tiles_editor_plugin.cpp index fad36660d9..78522dfa73 100644 --- a/editor/plugins/tiles/tiles_editor_plugin.cpp +++ b/editor/plugins/tiles/tiles_editor_plugin.cpp @@ -117,7 +117,7 @@ void TilesEditorPlugin::_thread() { tile_map->set_position(-(scale * encompassing_rect.get_center()) + thumbnail_size2 / 2); // Add the viewport at the last moment to avoid rendering too early. - EditorNode::get_singleton()->add_child(viewport); + EditorNode::get_singleton()->call_deferred("add_child", viewport); RS::get_singleton()->connect(SNAME("frame_pre_draw"), callable_mp(const_cast<TilesEditorPlugin *>(this), &TilesEditorPlugin::_preview_frame_started), Object::CONNECT_ONE_SHOT); |