From 7df78b272df86fe086aa2c2ac808a5e937a60cf1 Mon Sep 17 00:00:00 2001 From: NicoleKai Date: Sun, 28 Apr 2024 21:40:08 -0600 Subject: [PATCH] fix break --- src/lib.rs | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/src/lib.rs b/src/lib.rs index 43b6fcd..747c01a 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -527,14 +527,20 @@ fn grab_gizmo( initial_transform_query: Query>, ) { if mouse_button_input.just_pressed(MouseButton::Left) { - for (mut gizmo, mut interaction, _transform) in gizmo_query.iter_mut() { - if *interaction == PickingInteraction::Hovered { - for (selection, transform, entity, rotation_origin_offset) in + for (mut gizmo, interaction, _transform) in gizmo_query.iter_mut() { + // if *interaction == PickingInteraction::Hovered { + // for (selection, transform, entity, rotation_origin_offset) in + // selected_items_query.iter() + // { + // ev_gizmo_update.send(GizmoUpdate::Hover { entity }); + // } + // *interaction = PickingInteraction::Pressed; + if *interaction == PickingInteraction::Pressed { + for (_selection, _transform, entity, _rotation_origin_offset) in selected_items_query.iter() { - ev_gizmo_update.send(GizmoUpdate::Hover { entity: entity }); + ev_gizmo_update.send(GizmoUpdate::Grab { entity }); } - *interaction = PickingInteraction::Pressed; // Dragging has started, store the initial position of all selected meshes for (selection, transform, entity, rotation_origin_offset) in selected_items_query.iter()