diff --git a/editor/plugins/tiles/tile_set_atlas_source_editor.cpp b/editor/plugins/tiles/tile_set_atlas_source_editor.cpp index 927e805f71a..69ac2a980e3 100644 --- a/editor/plugins/tiles/tile_set_atlas_source_editor.cpp +++ b/editor/plugins/tiles/tile_set_atlas_source_editor.cpp @@ -990,7 +990,6 @@ void TileSetAtlasSourceEditor::_update_atlas_view() { // Create and position the button. Button *button = memnew(Button); - alternative_tiles_control->add_child(button); button->set_flat(true); button->set_icon(get_theme_icon(SNAME("Add"), SNAME("EditorIcons"))); button->add_theme_style_override("normal", memnew(StyleBoxEmpty)); @@ -1000,6 +999,7 @@ void TileSetAtlasSourceEditor::_update_atlas_view() { button->connect("pressed", callable_mp(tile_set_atlas_source, &TileSetAtlasSource::create_alternative_tile).bind(tile_id, TileSetSource::INVALID_TILE_ALTERNATIVE)); button->set_rect(Rect2(Vector2(pos.x, pos.y + (y_increment - texture_region_base_size.y) / 2.0), Vector2(texture_region_base_size_min, texture_region_base_size_min))); button->set_expand_icon(true); + alternative_tiles_control->add_child(button); pos.y += y_increment; }