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
Unfocus children in Group#clearChildren() #6423
Unfocus children in Group#clearChildren() #6423
Conversation
After thinking about it some more, I believe not making |
Good find. I think Some notes: Having removed actors retain focus can cause errors and surprises. We don't always remove focus though, because sometimes removal is temporary and keeping the focus is desired. Adding an unfocus boolean to a bunch of methods isn't great, but gives the flexibility needed and helps people consider the issue. |
I wonder, should we have a Group |
We might as well for consistency with the |
@NathanSweet I've added a Group#clear(boolean unfocus) method if you're interested. I think you'll have to re-open the PR to be able to merge it in. |
No worries, I've made the change. |
…nge to override the (boolean) method. #6423
Group.removeActor(Actor child, boolean unfocus)
gives the option to unfocus the removed child.Group.removeActor(Actor child)
unfocuses the removed child (callsremoveActor(child, true)
).For some reason,
Group.clearChildren()
currently does not unfocus the children. This looks wrong.This PR adds a
clearChildren(boolean unfocus)
method.Now the question is: do you want
clearChildren()
(no arguments) to unfocus likeremoveActor(child)
does, or do you wantclearChildren()
to not unfocus to avoid potentially breaking apps which may rely on the fact that clearChildren() never unfocused until now? I'm all for breaking apps, but 🤷.