diff options
author | Rémi Verschelde <rverschelde@gmail.com> | 2023-04-28 17:08:33 +0200 |
---|---|---|
committer | Rémi Verschelde <rverschelde@gmail.com> | 2023-04-28 17:08:33 +0200 |
commit | e8f5d0f6e8867902874f663b3dbf339a7fe61b45 (patch) | |
tree | 5b9f7346483db244f4ad86a8ad579c1aa325b3ef | |
parent | 012e2b741152e14bbe70297779b8029278690301 (diff) | |
parent | e5d0bb1605e93041c7329374cccdf8290e1574e2 (diff) | |
download | redot-engine-e8f5d0f6e8867902874f663b3dbf339a7fe61b45.tar.gz |
Merge pull request #76546 from KoBeWi/prevent_shape_editor_from_killing_Godot
Fix CollisionShape2D editor crash
-rw-r--r-- | editor/plugins/collision_shape_2d_editor_plugin.cpp | 10 | ||||
-rw-r--r-- | editor/plugins/collision_shape_2d_editor_plugin.h | 8 |
2 files changed, 3 insertions, 15 deletions
diff --git a/editor/plugins/collision_shape_2d_editor_plugin.cpp b/editor/plugins/collision_shape_2d_editor_plugin.cpp index 64a3346224..0aef364c2d 100644 --- a/editor/plugins/collision_shape_2d_editor_plugin.cpp +++ b/editor/plugins/collision_shape_2d_editor_plugin.cpp @@ -552,16 +552,6 @@ void CollisionShape2DEditor::edit(Node *p_node) { _shape_changed(); } -CollisionShape2DEditor::CollisionShape2DEditor() { - node = nullptr; - canvas_item_editor = nullptr; - - edit_handle = -1; - pressed = false; - - shape_type = 0; -} - void CollisionShape2DEditorPlugin::edit(Object *p_obj) { collision_shape_2d_editor->edit(Object::cast_to<Node>(p_obj)); } diff --git a/editor/plugins/collision_shape_2d_editor_plugin.h b/editor/plugins/collision_shape_2d_editor_plugin.h index 749245ae28..13a99ec6f3 100644 --- a/editor/plugins/collision_shape_2d_editor_plugin.h +++ b/editor/plugins/collision_shape_2d_editor_plugin.h @@ -66,9 +66,9 @@ class CollisionShape2DEditor : public Control { Vector<Point2> handles; - int shape_type; - int edit_handle; - bool pressed; + int shape_type = -1; + int edit_handle = -1; + bool pressed = false; Variant original; Transform2D original_transform; Vector2 original_point; @@ -90,8 +90,6 @@ public: bool forward_canvas_gui_input(const Ref<InputEvent> &p_event); void forward_canvas_draw_over_viewport(Control *p_overlay); void edit(Node *p_node); - - CollisionShape2DEditor(); }; class CollisionShape2DEditorPlugin : public EditorPlugin { |