mirror of
https://github.com/bevyengine/bevy
synced 2024-11-10 07:04:33 +00:00
Add back missing DragOver event dispatcher
This commit is contained in:
parent
f04f679e9e
commit
e909387011
1 changed files with 21 additions and 1 deletions
|
@ -525,10 +525,30 @@ pub fn pointer_events(
|
|||
drag.latest_pos = location.position;
|
||||
let event = Pointer::new(pointer_id, location.clone(), drag_event);
|
||||
commands.trigger_targets(event, *drag_target);
|
||||
|
||||
// Emit corresponding DragOver to the hovered entities
|
||||
for (hovered_entity, hit) in hover_map
|
||||
.get(&pointer_id)
|
||||
.iter()
|
||||
.flat_map(|h| h.iter().map(|(entity, data)| (*entity, data.to_owned())))
|
||||
.filter(|(hovered_entity, _)| *hovered_entity != *drag_target)
|
||||
{
|
||||
commands.trigger_targets(
|
||||
Pointer::new(
|
||||
pointer_id,
|
||||
location.clone(),
|
||||
DragOver {
|
||||
button,
|
||||
dragged: *drag_target,
|
||||
hit: hit.clone(),
|
||||
},
|
||||
),
|
||||
hovered_entity,
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Triggers during movement over specific entities
|
||||
for (hovered_entity, hit) in hover_map
|
||||
.get(&pointer_id)
|
||||
.iter()
|
||||
|
|
Loading…
Reference in a new issue