Merge pull request #73218 from akien-mga/3.x-fix-tileset-collisionshape-resize

[3.x] TileSet: Fix resizing collision shape when vertex is outside the tilesheet
This commit is contained in:
Rémi Verschelde 2023-02-17 12:15:50 +01:00
commit 0cba0a0032
No known key found for this signature in database
GPG Key ID: C3336907360768E1
1 changed files with 7 additions and 0 deletions

View File

@ -1588,6 +1588,13 @@ void TileSetEditor::_on_workspace_input(const Ref<InputEvent> &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) {