Skip to content

Commit

Permalink
Don't throw exception if parent is neither FlameGame nor ReadonlySize…
Browse files Browse the repository at this point in the history
…Provider
  • Loading branch information
lohnn committed Jul 18, 2023
1 parent 346bb6c commit 339c45b
Showing 1 changed file with 1 addition and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -81,9 +81,7 @@ class HudMarginComponent extends PositionComponent {
@override
void onGameResize(Vector2 size) {
super.onGameResize(size);
if (isMounted &&
(parent is FlameGame ||
(parent! as ReadonlySizeProvider).size is NotifyingVector2)) {
if (isMounted && _sizeProvider != null) {
_updateMargins();
}
}
Expand Down

0 comments on commit 339c45b

Please sign in to comment.