Skip to content
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

Fix Interaction not resetting to None sometimes #1315

Merged
merged 2 commits into from
Feb 1, 2021

Conversation

Davier
Copy link
Contributor

@Davier Davier commented Jan 25, 2021

This corrects two bugs in ui_focus_system:

  • When clicking and releasing a button in a single frame, it stays stuck in Interaction::Clicked until the next mouse click
  • It's possible for nodes to not be un-hovered in some cases with FocusPolicy::Pass, such as when they get covered by new nodes

I noticed that touch input is using just_released instead of just_pressed for clicking, which means that the 1st issue may have been a feature for them. With this PR, the buttons would no longer stay stuck in the Clicked state after any released touch. If that behaviour was intended I can easily re-introduce it.

@cart
Copy link
Member

cart commented Feb 1, 2021

This looks good to me. Touch input appears to be completely broken ... not due to this pr, but due to the recent move to using window.cursor_position (which touch does not set).

I think we'll want to incorporate the touch location too (in a separate pr).

@cart cart merged commit 1d3dfd3 into bevyengine:master Feb 1, 2021
@Davier Davier deleted the fix_ui_focus branch February 1, 2021 03:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants