aboutsummaryrefslogtreecommitdiff
path: root/tools/editor/plugins/collision_polygon_editor_plugin.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'tools/editor/plugins/collision_polygon_editor_plugin.cpp')
-rw-r--r--tools/editor/plugins/collision_polygon_editor_plugin.cpp17
1 files changed, 2 insertions, 15 deletions
diff --git a/tools/editor/plugins/collision_polygon_editor_plugin.cpp b/tools/editor/plugins/collision_polygon_editor_plugin.cpp
index a6f2085a1..126328bac 100644
--- a/tools/editor/plugins/collision_polygon_editor_plugin.cpp
+++ b/tools/editor/plugins/collision_polygon_editor_plugin.cpp
@@ -70,19 +70,6 @@ void CollisionPolygonEditor::_node_removed(Node *p_node) {
}
-Vector2 CollisionPolygonEditor::snap_point(const Vector2& p_point) const {
-
- return p_point;
-
- if (CanvasItemEditor::get_singleton()->is_snap_active()) {
-
- return p_point.snapped(Vector2(1,1)*CanvasItemEditor::get_singleton()->get_snap());
-
- } else {
- return p_point;
- }
-}
-
void CollisionPolygonEditor::_menu_option(int p_option) {
switch(p_option) {
@@ -150,7 +137,7 @@ bool CollisionPolygonEditor::forward_spatial_input_event(Camera* p_camera,const
Vector2 cpoint(spoint.x,spoint.y);
- cpoint=snap_point(cpoint);
+ cpoint=CanvasItemEditor::get_singleton()->snap_point(cpoint);
Vector<Vector2> poly = node->get_polygon();
@@ -364,7 +351,7 @@ bool CollisionPolygonEditor::forward_spatial_input_event(Camera* p_camera,const
Vector2 cpoint(spoint.x,spoint.y);
- cpoint=snap_point(cpoint);
+ cpoint=CanvasItemEditor::get_singleton()->snap_point(cpoint);
edited_point_pos = cpoint;
_polygon_draw();