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: Only use pre-set ReadonlySizeProvider for sizing in HudMarginComponent #2611

Merged
merged 1 commit into from
Jul 18, 2023

Conversation

lohnn
Copy link
Contributor

@lohnn lohnn commented Jul 18, 2023

Description

In a project where we wrapped the JoystickComponent into it's own Component to separate concerns resizing the window (or hot reloading) would throw an exception leading to a red screen.

The HudMarginComponent currently expects the parent to be either a FlameGame or ReadOnlySizeProvider, which throws an exception when our wrapped Joystick class is neither.

With the help of @spydon, we came to the conclusion that this fix should work and not break other cases.

Checklist

  • I have followed the Contributor Guide when preparing my PR.
  • I have updated/added tests for ALL new/updated/fixed functionality.
  • I have updated/added relevant documentation in docs and added dartdoc comments with ///.
  • I have updated/added relevant examples in examples or docs.

Breaking Change?

  • Yes, this PR is a breaking change.
  • No, this PR is not a breaking change.

Related Issues

No related issue, I can open one if needed.

@spydon spydon changed the title fix: Don't throw exception if parent is neither FlameGame nor ReadonlySize… fix: Only use pre-set ReadonlySizeProvider for sizing in HudMarginComponent Jul 18, 2023
@spydon spydon merged commit 832c051 into flame-engine:main Jul 18, 2023
7 checks passed
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