浏览代码

Make sure tile is selected when selecting TileMap

Tomasz Chabora 5 年之前
父节点
当前提交
f7476359e0
共有 1 个文件被更改,包括 1 次插入0 次删除
  1. 1 0
      editor/plugins/tile_map_editor_plugin.cpp

+ 1 - 0
editor/plugins/tile_map_editor_plugin.cpp

@@ -515,6 +515,7 @@ void TileMapEditor::_update_palette() {
 		sel_tile = selected.get(Math::rand() % selected.size());
 	} else if (palette->get_item_count() > 0) {
 		palette->select(0);
+		sel_tile = palette->get_selected_items().get(0);
 	}
 
 	if (sel_tile != TileMap::INVALID_CELL && ((manual_autotile && tileset->tile_get_tile_mode(sel_tile) == TileSet::AUTO_TILE) || (!priority_atlastile && tileset->tile_get_tile_mode(sel_tile) == TileSet::ATLAS_TILE))) {