Skip to content

Commit

Permalink
Reorder PickSet::Focus systems (#16791)
Browse files Browse the repository at this point in the history
# Objective

- `PointerInteraction` components should be updated before sending
picking events. Otherwise they will be stale when event observers run.
- Allow inserting logic before picking events but after
`PointerInteraction` components have been updated.

## Solution

- Reorder systems in `PickSet::Focus`.
  • Loading branch information
UkoeHB authored Dec 13, 2024
1 parent 00722b8 commit 72079cf
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion crates/bevy_picking/src/focus.rs
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@ pub enum PickingInteraction {
None = 0,
}

/// Uses pointer events to update [`PointerInteraction`] and [`PickingInteraction`] components.
/// Uses [`HoverMap`] changes to update [`PointerInteraction`] and [`PickingInteraction`] components.
pub fn update_interactions(
// Input
hover_map: Res<HoverMap>,
Expand Down
2 changes: 1 addition & 1 deletion crates/bevy_picking/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -414,7 +414,7 @@ impl Plugin for InteractionPlugin {
.add_event::<Pointer<Released>>()
.add_systems(
PreUpdate,
(update_focus, pointer_events, update_interactions)
(update_focus, update_interactions, pointer_events)
.chain()
.in_set(PickSet::Focus),
);
Expand Down

0 comments on commit 72079cf

Please sign in to comment.