summaryrefslogtreecommitdiffstats
path: root/editor/plugins/collision_shape_2d_editor_plugin.cpp
diff options
context:
space:
mode:
authorEric M <itsjusteza@gmail.com>2023-01-10 21:30:07 +1000
committerEric M <itsjusteza@gmail.com>2023-01-10 21:30:07 +1000
commit871ddf80c097717ad55026ce0cf60481af489eae (patch)
treed9f8b397e56da073d3cc83887704ff7e13a43d93 /editor/plugins/collision_shape_2d_editor_plugin.cpp
parent269fa200d04ae96b0114b788e18df638c5fb164b (diff)
downloadredot-engine-871ddf80c097717ad55026ce0cf60481af489eae.tar.gz
Fix cancelling selection (pressing escape) while gizmo editing making uncommitted changes.
* Pressing escape while gizmo editing will discard the changes made during that edit 'session'
Diffstat (limited to 'editor/plugins/collision_shape_2d_editor_plugin.cpp')
-rw-r--r--editor/plugins/collision_shape_2d_editor_plugin.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/editor/plugins/collision_shape_2d_editor_plugin.cpp b/editor/plugins/collision_shape_2d_editor_plugin.cpp
index bed4658976..c1ed5a31ff 100644
--- a/editor/plugins/collision_shape_2d_editor_plugin.cpp
+++ b/editor/plugins/collision_shape_2d_editor_plugin.cpp
@@ -356,6 +356,7 @@ bool CollisionShape2DEditor::forward_canvas_gui_input(const Ref<InputEvent> &p_e
return false;
}
+ original_point = handles[edit_handle];
original = get_handle_value(edit_handle);
original_transform = node->get_global_transform();
last_point = original;
@@ -572,6 +573,11 @@ void CollisionShape2DEditor::edit(Node *p_node) {
_get_current_shape_type();
} else {
+ if (pressed) {
+ set_handle(edit_handle, original_point);
+ pressed = false;
+ }
+
edit_handle = -1;
shape_type = -1;