close
Skip to content

Fix Interaction not resetting to None sometimes#1315

Merged
cart merged 2 commits into
bevyengine:masterfrom
Davier:fix_ui_focus
Feb 1, 2021
Merged

Fix Interaction not resetting to None sometimes#1315
cart merged 2 commits into
bevyengine:masterfrom
Davier:fix_ui_focus

Conversation

@Davier
Copy link
Copy Markdown
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
Copy Markdown
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.

2 participants