diff options
author | Tomasz Chabora <kobewi4e@gmail.com> | 2019-11-13 14:25:50 +0100 |
---|---|---|
committer | Tomasz Chabora <kobewi4e@gmail.com> | 2019-11-13 14:26:37 +0100 |
commit | f7476359e0bac2c7741b443010827030b8545ea3 (patch) | |
tree | c85ab70f26a0b1e35b52faad81522f0f131fd602 | |
parent | 35444576ff684aebb0133d46495be85d3d434900 (diff) |
Make sure tile is selected when selecting TileMap
-rw-r--r-- | editor/plugins/tile_map_editor_plugin.cpp | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/editor/plugins/tile_map_editor_plugin.cpp b/editor/plugins/tile_map_editor_plugin.cpp index 10567557d6..385ba4cfda 100644 --- a/editor/plugins/tile_map_editor_plugin.cpp +++ b/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))) { |