diff options
author | Tomasz Chabora <kobewi4e@gmail.com> | 2020-08-30 23:15:00 +0200 |
---|---|---|
committer | kobewi <kobewi4e@gmail.com> | 2021-08-11 17:34:27 +0200 |
commit | f12f5b36b58e3269cfa981744e4702ef68e81b49 (patch) | |
tree | 693e80f3eaa55c6da9aaba6cd6f278984447da33 /editor | |
parent | c00303ff55f2a67d5cb1a031070e3b1fe7b15a9e (diff) |
Make radius & height in CapsuleShape2D independent
Diffstat (limited to 'editor')
-rw-r--r-- | editor/plugins/collision_shape_2d_editor_plugin.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/editor/plugins/collision_shape_2d_editor_plugin.cpp b/editor/plugins/collision_shape_2d_editor_plugin.cpp index 5a6b7d98d3..4266e0f676 100644 --- a/editor/plugins/collision_shape_2d_editor_plugin.cpp +++ b/editor/plugins/collision_shape_2d_editor_plugin.cpp @@ -120,7 +120,7 @@ void CollisionShape2DEditor::set_handle(int idx, Point2 &p_point) { if (idx == 0) { capsule->set_radius(parameter); } else if (idx == 1) { - capsule->set_height(parameter * 2 - capsule->get_radius() * 2); + capsule->set_height(parameter * 2); } canvas_item_editor->update_viewport(); @@ -440,8 +440,8 @@ void CollisionShape2DEditor::forward_canvas_draw_over_viewport(Control *p_overla float radius = shape->get_radius(); float height = shape->get_height() / 2; - handles.write[0] = Point2(radius, height); - handles.write[1] = Point2(0, height + radius); + handles.write[0] = Point2(radius, 0); + handles.write[1] = Point2(0, height); p_overlay->draw_texture(h, gt.xform(handles[0]) - size); p_overlay->draw_texture(h, gt.xform(handles[1]) - size); |