From 2a1614b0048f6b035b58b0824bb5235b9552af41 Mon Sep 17 00:00:00 2001 From: RustyStriker Date: Thu, 4 Aug 2022 18:15:02 +0300 Subject: [PATCH] snap now works when creating as well --- src/create.rs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/create.rs b/src/create.rs index 9c9dd12..0ab7ec8 100644 --- a/src/create.rs +++ b/src/create.rs @@ -13,10 +13,12 @@ pub fn create_sys( q_cam: Query<(&Camera, &GlobalTransform), With>, mut paths: Query<&mut Path>, mut transforms: Query<&mut Transform>, + snap: Res, ) { let mouse_pos = get_mouse_pos(&q_cam, &wnds); if let Some(mouse_pos) = mouse_pos { + let mouse_pos = snap.snap_to_grid(mouse_pos); if let Some(sd) = &mut *first_point { update_main_shape_creation(&mut paths, &transforms, sd, mouse_pos);