Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix CollisionShape2D editor crash #76546

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 0 additions & 10 deletions editor/plugins/collision_shape_2d_editor_plugin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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));
}
Expand Down
8 changes: 3 additions & 5 deletions editor/plugins/collision_shape_2d_editor_plugin.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -90,8 +90,6 @@ class CollisionShape2DEditor : public Control {
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 {
Expand Down