Skip to content

don't filter dragged entity out of DragEnter events #19179

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

tomara-x
Copy link
Contributor

produce a DragEnter event when reentering the dragged entity

when making a piano, i want dragging across the keys to trigger the notes of each key, but currently if i drag out of a key, then back to it, this will not work since the dragged entity gets filtered out

Solution

  • make DragEnter event work whenever there's an entry. if the user wants to ignore the dragged entity they can compare target and dragged

Testing

  • tested this with a modified version of the 2d_shapes example. i added an observer to the entities: (and added mesh picking plugin)
.observe(|t: Trigger<Pointer<DragEnter>>| {
    info!("entered {}, started from {}", t.target(), t.dragged);
}
  • i'm not sure if other things need more testing, or if this is wrong completely and breaks other things i don't know of!

Showcase

before:

2025-05-12_04-19-42.mp4

after:

2025-05-12_04-22-28.mp4

@atlv24 atlv24 added C-Bug An unexpected or incorrect behavior M-Needs-Migration-Guide A breaking change to Bevy's public API that needs to be noted in a migration guide D-Straightforward Simple bug fixes and API improvements, docs, test and examples S-Needs-Review Needs reviewer attention (from anyone!) to move forward A-Picking Pointing at and selecting objects of all sorts labels May 12, 2025
Copy link
Contributor

It looks like your PR is a breaking change, but you didn't provide a migration guide.

Please review the instructions for writing migration guides, then expand or revise the content in the migration guides directory to reflect your changes.

@atlv24 atlv24 requested a review from NthTensor May 12, 2025 08:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-Picking Pointing at and selecting objects of all sorts C-Bug An unexpected or incorrect behavior D-Straightforward Simple bug fixes and API improvements, docs, test and examples M-Needs-Migration-Guide A breaking change to Bevy's public API that needs to be noted in a migration guide S-Needs-Review Needs reviewer attention (from anyone!) to move forward
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants