snap now works when creating as well
This commit is contained in:
parent
f76cab4129
commit
2a1614b004
1 changed files with 2 additions and 0 deletions
|
@ -13,10 +13,12 @@ pub fn create_sys(
|
||||||
q_cam: Query<(&Camera, &GlobalTransform), With<MainCamera>>,
|
q_cam: Query<(&Camera, &GlobalTransform), With<MainCamera>>,
|
||||||
mut paths: Query<&mut Path>,
|
mut paths: Query<&mut Path>,
|
||||||
mut transforms: Query<&mut Transform>,
|
mut transforms: Query<&mut Transform>,
|
||||||
|
snap: Res<SnapGrid>,
|
||||||
) {
|
) {
|
||||||
let mouse_pos = get_mouse_pos(&q_cam, &wnds);
|
let mouse_pos = get_mouse_pos(&q_cam, &wnds);
|
||||||
|
|
||||||
if let Some(mouse_pos) = mouse_pos {
|
if let Some(mouse_pos) = mouse_pos {
|
||||||
|
let mouse_pos = snap.snap_to_grid(mouse_pos);
|
||||||
|
|
||||||
if let Some(sd) = &mut *first_point {
|
if let Some(sd) = &mut *first_point {
|
||||||
update_main_shape_creation(&mut paths, &transforms, sd, mouse_pos);
|
update_main_shape_creation(&mut paths, &transforms, sd, mouse_pos);
|
||||||
|
|
Loading…
Reference in a new issue