bevy/crates/bevy_picking
Miles Silberling-Cook d7ea5b6aa9
Various picking bugfixes (#15293)
# Objective

- Intended to resolve https://github.com/bevyengine/bevy/issues/15290.
- Fix four duplicate `DragEnd` firing when drag finished.
- Fix redundant `DragStart` firing when dragging across pick-able
entities.
- Fix `Click` coming after `Drop` and obliterating finished drag
interactions.

Big thanks to B. Reinhart for testing picking in their codebase and
identifying these issues early.

## Solution

- Fix press & drag state being cleared after the first entity is read
from the hover map on pointer release, rather than after all entities
are read. This caused only the first hovered entity to receive `Up` and
`Click` events.
- Fixes `Down` being determined using the `previous_hover_map` rather
than `hover_map`, a regression compared to `bevy_mod_picking`. I think
this is what was messing up drag events.
- Fixes and issue where `PointerEnd` would fire multiple times and
`PointerStart` would fire when dragging onto a new entity.
- Re-orders events to make them easier to handle. `Out` now fired before
`DragLeave` and `Click/Up` now fire before `DragDrop`.
- Generally refactors the picking event code to be more clean and sane. 

## Testing

These changes are currently sporadically tested.
2024-09-20 00:55:41 +00:00
..
src Various picking bugfixes (#15293) 2024-09-20 00:55:41 +00:00
Cargo.toml Picking event ordering (#14862) 2024-09-04 19:41:06 +00:00
README.md Upstream CorePlugin from bevy_mod_picking (#13677) 2024-06-15 11:59:57 +00:00

Bevy Picking