From 527fb3968a70e530468e5c96c910fab6051af344 Mon Sep 17 00:00:00 2001 From: Hugo Locurcio Date: Tue, 2 Jul 2019 20:00:00 +0200 Subject: Implement snapping in the CSG gizmos and 3D polygon editor The spatial editor snap settings will now affect the CSG gizmos and 3D polygon editor (which is used in CSGPolygon). --- editor/plugins/collision_polygon_editor_plugin.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'editor/plugins') 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 Refsnap_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; -- cgit v1.2.3