summaryrefslogtreecommitdiff
path: root/editor/plugins
diff options
context:
space:
mode:
authorRĂ©mi Verschelde <rverschelde@gmail.com>2019-07-03 07:01:01 +0200
committerGitHub <noreply@github.com>2019-07-03 07:01:01 +0200
commit8c78a4b78f8c25278226919baf78ffe06872b676 (patch)
treedf250bed6b270ed7d706b69da50620c841a00d60 /editor/plugins
parentda622682f76201655f96c13c17c273e72d3a9678 (diff)
parent527fb3968a70e530468e5c96c910fab6051af344 (diff)
Merge pull request #30264 from Calinou/add-csg-gizmo-snapping
Implement snapping in the CSG gizmos and 3D polygon editor
Diffstat (limited to 'editor/plugins')
-rw-r--r--editor/plugins/collision_polygon_editor_plugin.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/editor/plugins/collision_polygon_editor_plugin.cpp b/editor/plugins/collision_polygon_editor_plugin.cpp
index 87cb0d04a2..8cf09406c7 100644
--- a/editor/plugins/collision_polygon_editor_plugin.cpp
+++ b/editor/plugins/collision_polygon_editor_plugin.cpp
@@ -346,8 +346,10 @@ bool Polygon3DEditor::forward_spatial_gui_input(Camera *p_camera, const Ref<Inpu
snap_ignore = false;
}
- if (!snap_ignore) {
- cpoint = CanvasItemEditor::get_singleton()->snap_point(cpoint);
+ if (!snap_ignore && SpatialEditor::get_singleton()->is_snap_enabled()) {
+ cpoint = cpoint.snapped(Vector2(
+ SpatialEditor::get_singleton()->get_translate_snap(),
+ SpatialEditor::get_singleton()->get_translate_snap()));
}
edited_point_pos = cpoint;