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

Make sure this button enabled thing is fixed #226

Open
MattRix opened this issue Apr 9, 2014 · 0 comments
Open

Make sure this button enabled thing is fixed #226

MattRix opened this issue Apr 9, 2014 · 0 comments
Assignees

Comments

@MattRix
Copy link
Owner

MattRix commented Apr 9, 2014

I believe I've already fixed this in unstable, but it's worth checking just in case:

---below is from an email---

The next little problem with buttons is the enabled state. I made some buttons and disabled them, but they still responded to touches. The initial HandleSingleTouchBegan() has a check for the enabled state, and if the hitrect is valid but the button is disabled the button swallows the touch by returning true but doesn't process the down state etc. All good. The problem is that because of the return true to swallow that first touch event, the following touch events for movement and ended get sent to the button, but there's no further checks for the enabled state in the handlers so they just go about their business, which means they show a down state and then trigger a pressed event as normal. I added a line at the top of HandleSingleTouchMoved() and HandleSingleTouchEnded() to bail out if the button is disabled - if (!_isEnabled) return; The over handler also breaks if the button is disabled as well. I'm not using it, but I quickly edited UpdateOverState() and used the following in the hitrect check; if (_isEnabled && _hitRect.Contains(mousePos)) ... { over stuff }...

@MattRix MattRix self-assigned this Apr 9, 2014
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

No branches or pull requests

1 participant