Skip to content

Conversation

@livtanong
Copy link
Contributor

Description

In some cases, like when a PaddingComponent with inflateChild = true wraps a ColumnComponent, we get a stack overflow.
This is because setLayoutSize was implemented as setLayoutAxisLength on both axes. At first glance, this seems equivalent, but the first invocation would trip all size listeners before the second invocation completes. This meant that the guard statement of SingleChildLayoutComponent.syncChildSize would never execute in the case of a PaddingComponent with inflateChild set to true wrapping the LayoutComponent. Thus, infinite loop.

This PR fixes the implementation of both setLayoutSize and resetSize.

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

@livtanong livtanong changed the title fix: setLayoutSize should only notify once fix: Reimplement setLayoutSize to only notify once Jan 6, 2026
Copy link
Member

@spydon spydon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lgtm, except the commented out code
Thanks for your fix!

@spydon
Copy link
Member

spydon commented Jan 6, 2026

Fixed the failing pipeline step in #3797

@spydon spydon enabled auto-merge (squash) January 6, 2026 15:01
@spydon spydon merged commit 97f8beb into flame-engine:main Jan 6, 2026
68 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