From c8d64e8580da5bf53ccbb5790389b310d3d68e2d Mon Sep 17 00:00:00 2001 From: kobewi Date: Sun, 7 May 2023 02:32:20 +0200 Subject: Fix another collision shape editor crash (cherry picked from commit 01c32dffafddd52e65b8413034b2f5283523da92) --- editor/plugins/collision_shape_2d_editor_plugin.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'editor') diff --git a/editor/plugins/collision_shape_2d_editor_plugin.cpp b/editor/plugins/collision_shape_2d_editor_plugin.cpp index 0aef364c2d..204d783df1 100644 --- a/editor/plugins/collision_shape_2d_editor_plugin.cpp +++ b/editor/plugins/collision_shape_2d_editor_plugin.cpp @@ -436,7 +436,7 @@ void CollisionShape2DEditor::forward_canvas_draw_over_viewport(Control *p_overla switch (shape_type) { case CAPSULE_SHAPE: { - Ref shape = node->get_shape(); + Ref shape = current_shape; handles.resize(2); float radius = shape->get_radius(); @@ -451,7 +451,7 @@ void CollisionShape2DEditor::forward_canvas_draw_over_viewport(Control *p_overla } break; case CIRCLE_SHAPE: { - Ref shape = node->get_shape(); + Ref shape = current_shape; handles.resize(1); handles.write[0] = Point2(shape->get_radius(), 0); @@ -467,7 +467,7 @@ void CollisionShape2DEditor::forward_canvas_draw_over_viewport(Control *p_overla } break; case WORLD_BOUNDARY_SHAPE: { - Ref shape = node->get_shape(); + Ref shape = current_shape; handles.resize(2); handles.write[0] = shape->get_normal() * shape->get_distance(); @@ -479,7 +479,7 @@ void CollisionShape2DEditor::forward_canvas_draw_over_viewport(Control *p_overla } break; case SEPARATION_RAY_SHAPE: { - Ref shape = node->get_shape(); + Ref shape = current_shape; handles.resize(1); handles.write[0] = Point2(0, shape->get_length()); @@ -489,7 +489,7 @@ void CollisionShape2DEditor::forward_canvas_draw_over_viewport(Control *p_overla } break; case RECTANGLE_SHAPE: { - Ref shape = node->get_shape(); + Ref shape = current_shape; handles.resize(8); Vector2 ext = shape->get_size() / 2; @@ -501,7 +501,7 @@ void CollisionShape2DEditor::forward_canvas_draw_over_viewport(Control *p_overla } break; case SEGMENT_SHAPE: { - Ref shape = node->get_shape(); + Ref shape = current_shape; handles.resize(2); handles.write[0] = shape->get_a(); -- cgit v1.2.3