diff options
author | RĂ©mi Verschelde <remi@verschelde.fr> | 2021-08-14 09:36:16 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-08-14 09:36:16 +0200 |
commit | 59879447a395adc4ced2ee7e88b0ef1bcc32c82d (patch) | |
tree | a17c5dc4fddebd4379d57c3de0ba88a01638b87d /editor | |
parent | f32c042f3e14a2de2f2d416ff35b0a3c80785e33 (diff) | |
parent | 8e3f71d75060c70745f541d5cab509f7bea690df (diff) |
Merge pull request #51636 from Calinou/rename-lineshape2d
Rename LineShape2D to WorldMarginShape2D
Diffstat (limited to 'editor')
-rw-r--r-- | editor/icons/WorldMarginShape2D.svg (renamed from editor/icons/LineShape2D.svg) | 0 | ||||
-rw-r--r-- | editor/plugins/collision_shape_2d_editor_plugin.cpp | 22 | ||||
-rw-r--r-- | editor/plugins/collision_shape_2d_editor_plugin.h | 2 |
3 files changed, 12 insertions, 12 deletions
diff --git a/editor/icons/LineShape2D.svg b/editor/icons/WorldMarginShape2D.svg index f1dbe97c6f..f1dbe97c6f 100644 --- a/editor/icons/LineShape2D.svg +++ b/editor/icons/WorldMarginShape2D.svg diff --git a/editor/plugins/collision_shape_2d_editor_plugin.cpp b/editor/plugins/collision_shape_2d_editor_plugin.cpp index 4266e0f676..486f947e43 100644 --- a/editor/plugins/collision_shape_2d_editor_plugin.cpp +++ b/editor/plugins/collision_shape_2d_editor_plugin.cpp @@ -36,9 +36,9 @@ #include "scene/resources/circle_shape_2d.h" #include "scene/resources/concave_polygon_shape_2d.h" #include "scene/resources/convex_polygon_shape_2d.h" -#include "scene/resources/line_shape_2d.h" #include "scene/resources/rectangle_shape_2d.h" #include "scene/resources/segment_shape_2d.h" +#include "scene/resources/world_margin_shape_2d.h" void CollisionShape2DEditor::_node_removed(Node *p_node) { if (p_node == node) { @@ -74,8 +74,8 @@ Variant CollisionShape2DEditor::get_handle_value(int idx) const { case CONVEX_POLYGON_SHAPE: { } break; - case LINE_SHAPE: { - Ref<LineShape2D> line = node->get_shape(); + case WORLD_MARGIN_SHAPE: { + Ref<WorldMarginShape2D> line = node->get_shape(); if (idx == 0) { return line->get_distance(); @@ -142,9 +142,9 @@ void CollisionShape2DEditor::set_handle(int idx, Point2 &p_point) { case CONVEX_POLYGON_SHAPE: { } break; - case LINE_SHAPE: { + case WORLD_MARGIN_SHAPE: { if (idx < 2) { - Ref<LineShape2D> line = node->get_shape(); + Ref<WorldMarginShape2D> line = node->get_shape(); if (idx == 0) { line->set_distance(p_point.length()); @@ -241,8 +241,8 @@ void CollisionShape2DEditor::commit_handle(int idx, Variant &p_org) { // Cannot be edited directly, use CollisionPolygon2D instead. } break; - case LINE_SHAPE: { - Ref<LineShape2D> line = node->get_shape(); + case WORLD_MARGIN_SHAPE: { + Ref<WorldMarginShape2D> line = node->get_shape(); if (idx == 0) { undo_redo->add_do_method(line.ptr(), "set_distance", line->get_distance()); @@ -397,8 +397,8 @@ void CollisionShape2DEditor::_get_current_shape_type() { shape_type = CONCAVE_POLYGON_SHAPE; } else if (Object::cast_to<ConvexPolygonShape2D>(*s)) { shape_type = CONVEX_POLYGON_SHAPE; - } else if (Object::cast_to<LineShape2D>(*s)) { - shape_type = LINE_SHAPE; + } else if (Object::cast_to<WorldMarginShape2D>(*s)) { + shape_type = WORLD_MARGIN_SHAPE; } else if (Object::cast_to<RectangleShape2D>(*s)) { shape_type = RECTANGLE_SHAPE; } else if (Object::cast_to<SegmentShape2D>(*s)) { @@ -464,8 +464,8 @@ void CollisionShape2DEditor::forward_canvas_draw_over_viewport(Control *p_overla case CONVEX_POLYGON_SHAPE: { } break; - case LINE_SHAPE: { - Ref<LineShape2D> shape = node->get_shape(); + case WORLD_MARGIN_SHAPE: { + Ref<WorldMarginShape2D> shape = node->get_shape(); handles.resize(2); handles.write[0] = shape->get_normal() * shape->get_distance(); diff --git a/editor/plugins/collision_shape_2d_editor_plugin.h b/editor/plugins/collision_shape_2d_editor_plugin.h index 130ec708cf..056e1b5b7d 100644 --- a/editor/plugins/collision_shape_2d_editor_plugin.h +++ b/editor/plugins/collision_shape_2d_editor_plugin.h @@ -46,7 +46,7 @@ class CollisionShape2DEditor : public Control { CIRCLE_SHAPE, CONCAVE_POLYGON_SHAPE, CONVEX_POLYGON_SHAPE, - LINE_SHAPE, + WORLD_MARGIN_SHAPE, RECTANGLE_SHAPE, SEGMENT_SHAPE }; |