From 94d9b7f7e26f7508cf565053e8d232fcef12d3dc Mon Sep 17 00:00:00 2001 From: kurinoku <31811692+kurinoku@users.noreply.github.com> Date: Thu, 24 Sep 2020 13:19:48 -0300 Subject: [PATCH] Fixed tile_set_editor_plugin.cpp selection issue. Fixed issue where using arrows to change the selected tile would not reach all subtiles in an autotile, only going up to the second to last row and column. --- editor/plugins/tile_set_editor_plugin.cpp | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/editor/plugins/tile_set_editor_plugin.cpp b/editor/plugins/tile_set_editor_plugin.cpp index 75a2c26a0d3..ece009aa579 100644 --- a/editor/plugins/tile_set_editor_plugin.cpp +++ b/editor/plugins/tile_set_editor_plugin.cpp @@ -2133,7 +2133,6 @@ void TileSetEditor::_select_previous_tile() { int spacing = tileset->autotile_get_spacing(get_current_tile()); Vector2 size = tileset->tile_get_region(get_current_tile()).size; Vector2 cell_count = (size / (tileset->autotile_get_size(get_current_tile()) + Vector2(spacing, spacing))).floor(); - cell_count -= Vector2(1, 1); edited_shape_coord = cell_count; _select_edited_shape_coord(); } break; @@ -2190,11 +2189,11 @@ void TileSetEditor::_select_next_subtile() { int spacing = tileset->autotile_get_spacing(get_current_tile()); Vector2 size = tileset->tile_get_region(get_current_tile()).size; Vector2 cell_count = (size / (tileset->autotile_get_size(get_current_tile()) + Vector2(spacing, spacing))).floor(); - if (edited_shape_coord.x >= cell_count.x - 1 && edited_shape_coord.y >= cell_count.y - 1) { + if (edited_shape_coord.x > cell_count.x - 1 && edited_shape_coord.y > cell_count.y - 1) { _select_next_tile(); } else { edited_shape_coord.x++; - if (edited_shape_coord.x >= cell_count.x) { + if (edited_shape_coord.x > cell_count.x) { edited_shape_coord.x = 0; edited_shape_coord.y++; } @@ -2221,7 +2220,7 @@ void TileSetEditor::_select_previous_subtile() { } else { edited_shape_coord.x--; if (edited_shape_coord.x == -1) { - edited_shape_coord.x = cell_count.x - 1; + edited_shape_coord.x = cell_count.x; edited_shape_coord.y--; } _select_edited_shape_coord();