Repository navigation
Conversation
hannojg
force-pushed
the
hannojg/fix-cached-layout-rounding
branch
from
November 10, 2026 13:56
6b8ad0d to
0fd2a96
Compare
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Calling
YGNodeCalculateLayouttwice with identical constraints can change an auto-height root from58to57.666668, without measuring its content again. I reproduced #877 on both9d159f2dand currentmain(41118bd3).The layout cache stores unrounded measurements. A cache hit copies those values into the root's public layout dimensions, but the outer layout call skips pixel rounding because no layout was performed.
This preserves the root's rounded layout and
hasNewLayoutstate when its full layout cache is reused. Cached descendants still restore their unrounded dimensions for the ancestor's rounding pass.Added regression coverage for fractional widths and heights at different point scales, directly measured and content-sized roots, dirty measurements, and cached children whose parent moves. All 889 native tests pass in Debug and Release. The first two regressions fail with the original algorithm.
Changelog:
[General][Fixed] - Keep rounded Yoga root sizes stable when repeating a layout with unchanged constraints.