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: fix UIButton not releasing when enabled #64

Merged
merged 2 commits into from
Sep 7, 2021

Conversation

BenjaminAmos
Copy link
Contributor

If a UIButton is disabled whilst the mouse is being held over it, then the UIButton will still act as pressed even if the mouse button is released when it is re-enabled. The same applies if you release the button whilst it is disabled. The button only becomes un-pressed when you click it again. I have added a reproduction of this bug to my NUISamples project. The gif below shows this.
NUIButtonBug2

Destination Sol on Android has several buttons that are used to control the player ship (touch screen controls). These buttons are typically held, rather than pressed, to indicate that an action should be taken (see MovingBlocks/DestinationSol#588). When using NUI buttons to control the player ship, this issue is particually pronouced.

This pull request slightly adjusts the interaction region logic for buttons. It ensures that the interaction region is still present if the button is in the down state and then correspondingly only enables the button on mouse release if the button is enabled.

@skaldarnar skaldarnar added the Type: Bug Issues reporting and PRs fixing problems label Sep 7, 2021
@skaldarnar skaldarnar merged commit 77a7835 into MovingBlocks:master Sep 7, 2021
@BenjaminAmos BenjaminAmos deleted the button-disable-bug branch September 7, 2021 21:21
pollend added a commit that referenced this pull request Oct 5, 2021
* build(github): add 'labels.json' configuration

This PR adds the label configuration to `.github/labels.json`, which can be used to sync labels with
Financial-Times/github-label-sync

Co-authored-by: jdrueckert <jd.rueckert@googlemail.com>

* doc: update documentation with general content from tutorial (#61)

* doc: incorporate core widget overview from tutorial
* doc: incorporate content from Tutorial: Overview
* doc: incorporate the tutorial content about layouts
* doc: format markdown with prettier

* doc: migrate remaining nui docs from tutorial wiki (#62)

* chore: move flow-layout images into images dir
* doc: add miglayout docs from tutorial wiki
* doc: add skin docs from tutorial wiki

* feat: Add multiple pointer logic (#60)

Multiple items should now be interactable simultaneously, rather than sequentially. This allows, for example, for holding down two buttons at once on a touch screen. Input backends need to explicitly implement this, so existing behaviour should be preserved.

* fix: fix UIButton not releasing when enabled (#64)

Co-authored-by: Tobias Nett <skaldarnar@googlemail.com>
Co-authored-by: jdrueckert <jd.rueckert@googlemail.com>
Co-authored-by: BenjaminAmos <24301287+BenjaminAmos@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Bug Issues reporting and PRs fixing problems
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants