snap now works when creating as well

This commit is contained in:
RustyStriker 2022-08-04 18:15:02 +03:00
parent f76cab4129
commit 2a1614b004

View file

@ -13,10 +13,12 @@ pub fn create_sys(
q_cam: Query<(&Camera, &GlobalTransform), With<MainCamera>>,
mut paths: Query<&mut Path>,
mut transforms: Query<&mut Transform>,
snap: Res<SnapGrid>,
) {
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);