Skip to content

Commit

Permalink
fix: Call render properly from nested FlameGames (#3106)
Browse files Browse the repository at this point in the history
Old typo where `renderTree` should call `render` and not itself when the
parent isn't null, since otherwise it will cause an infinite recursion.
  • Loading branch information
spydon committed Mar 29, 2024
1 parent 233cc94 commit cb1e370
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/flame/lib/src/game/flame_game.dart
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ class FlameGame<W extends World> extends ComponentTreeRoot
@override
void renderTree(Canvas canvas) {
if (parent != null) {
renderTree(canvas);
render(canvas);
}
for (final component in children) {
component.renderTree(canvas);
Expand Down

0 comments on commit cb1e370

Please sign in to comment.