From 2a1f4a695df150dfdc4461a9cef211b4f5db5fc4 Mon Sep 17 00:00:00 2001 From: DashCell Date: Sun, 7 Mar 2021 21:28:02 -0300 Subject: [PATCH] TileSet: Fix resizing collision shape when vertex is outside the tilesheet Fixes #34970. --- modules/tile_map/tile_set_editor_plugin.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/modules/tile_map/tile_set_editor_plugin.cpp b/modules/tile_map/tile_set_editor_plugin.cpp index f365a7c69..cf1b3f22f 100644 --- a/modules/tile_map/tile_set_editor_plugin.cpp +++ b/modules/tile_map/tile_set_editor_plugin.cpp @@ -1606,6 +1606,13 @@ void TileSetEditor::_on_workspace_input(const Ref &p_ie) { const real_t grab_threshold = EDITOR_GET("editors/poly_editor/point_grab_radius"); shape_anchor += current_tile_region.position; if (tools[TOOL_SELECT]->is_pressed()) { + if (current_shape.size() > 0) { + for (int i = 0; i < current_shape.size(); i++) { + current_shape.set(i, snap_point(current_shape[i])); + } + workspace->update(); + } + if (mb.is_valid()) { if (mb->is_pressed() && mb->get_button_index() == BUTTON_LEFT) { if (edit_mode != EDITMODE_PRIORITY && current_shape.size() > 0) {