Bevy version
Current main, 2f4cf76
What you did
- run ui/button example
- press cursor down on button
- It reads "Pressed"
- Keep holding mouse button down
- Move cursor out of the Button Rect
- It still reads "Pressed" until the mouse is released, regardless of where the cursor is at the time of release
What were you expecting?
I would expect the button to stop being considered pressed when moving out of the bounds of the button.
At the very least I would expect it to stop being considered pressed when exiting the window.
Additional information
Now, that being said, I'm pretty sure we do want to keep the behaviour for buttons or other interactable UI elements to "capture mouse", but there should also be a way to set up an interactable element so that it considers moving out of the bounds as a "release"
Perhaps something like this to go with the Interaction enum? (Not very attached to the name)
pub enum CapturePolicy {
Capture,
NotCapture
}
Bevy version
Current main, 2f4cf76
What you did
What were you expecting?
I would expect the button to stop being considered pressed when moving out of the bounds of the button.
At the very least I would expect it to stop being considered pressed when exiting the window.
Additional information
Now, that being said, I'm pretty sure we do want to keep the behaviour for buttons or other interactable UI elements to "capture mouse", but there should also be a way to set up an interactable element so that it considers moving out of the bounds as a "release"
Perhaps something like this to go with the
Interactionenum? (Not very attached to the name)