Skip to content

Commit

Permalink
Merge pull request #76798 from KoBeWi/race_condition_except_there_is_…
Browse files Browse the repository at this point in the history
…no_thread

Fix another collision shape editor crash
  • Loading branch information
akien-mga committed May 8, 2023
2 parents 353efd7 + 01c32df commit 41f1ec1
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions editor/plugins/collision_shape_2d_editor_plugin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -441,7 +441,7 @@ void CollisionShape2DEditor::forward_canvas_draw_over_viewport(Control *p_overla

switch (shape_type) {
case CAPSULE_SHAPE: {
Ref<CapsuleShape2D> shape = node->get_shape();
Ref<CapsuleShape2D> shape = current_shape;

handles.resize(2);
float radius = shape->get_radius();
Expand All @@ -456,7 +456,7 @@ void CollisionShape2DEditor::forward_canvas_draw_over_viewport(Control *p_overla
} break;

case CIRCLE_SHAPE: {
Ref<CircleShape2D> shape = node->get_shape();
Ref<CircleShape2D> shape = current_shape;

handles.resize(1);
handles.write[0] = Point2(shape->get_radius(), 0);
Expand All @@ -472,7 +472,7 @@ void CollisionShape2DEditor::forward_canvas_draw_over_viewport(Control *p_overla
} break;

case WORLD_BOUNDARY_SHAPE: {
Ref<WorldBoundaryShape2D> shape = node->get_shape();
Ref<WorldBoundaryShape2D> shape = current_shape;

handles.resize(2);
handles.write[0] = shape->get_normal() * shape->get_distance();
Expand All @@ -484,7 +484,7 @@ void CollisionShape2DEditor::forward_canvas_draw_over_viewport(Control *p_overla
} break;

case SEPARATION_RAY_SHAPE: {
Ref<SeparationRayShape2D> shape = node->get_shape();
Ref<SeparationRayShape2D> shape = current_shape;

handles.resize(1);
handles.write[0] = Point2(0, shape->get_length());
Expand All @@ -494,7 +494,7 @@ void CollisionShape2DEditor::forward_canvas_draw_over_viewport(Control *p_overla
} break;

case RECTANGLE_SHAPE: {
Ref<RectangleShape2D> shape = node->get_shape();
Ref<RectangleShape2D> shape = current_shape;

handles.resize(8);
Vector2 ext = shape->get_size() / 2;
Expand All @@ -506,7 +506,7 @@ void CollisionShape2DEditor::forward_canvas_draw_over_viewport(Control *p_overla
} break;

case SEGMENT_SHAPE: {
Ref<SegmentShape2D> shape = node->get_shape();
Ref<SegmentShape2D> shape = current_shape;

handles.resize(2);
handles.write[0] = shape->get_a();
Expand Down

0 comments on commit 41f1ec1

Please sign in to comment.