Repository navigation
iOS: only invalidate on a preferred-size change along the scrolling axis - #77
Merged
Merged
Conversation
#76 made a cell's preferred attributes keep the layout's cross-axis size, but a vertical list at a fractional width (e.g. a 1174/3 pt iPhone Duo pane) still never settled. Logging the override shows it returns the layout's 391.3333435 on every pass; UIKit then pixel-aligns the preferred size to 391.3333333 and compares it with the flow layout's float-stored 391.3333435, so no value on our side can make them agree. Items are only self-sized along the scrolling axis, so CvLayout now overrides ShouldInvalidateLayout(preferred, original) and ignores cross-axis differences, with the same half-pixel tolerance the handler uses. Verified in PoolMath on the iPhone Duo simulator (iOS 27.2), without its app-side workaround: a cold launch while unfolded and a live fold/unfold both render the Timeline with no "stuck in its update loop". Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
#76 made a cell's preferred attributes keep the layout's cross-axis size, but a vertical list at a fractional width (e.g. a 1174/3 pt iPhone Duo pane) still never settled. Logging the override shows it returns the layout's 391.3333435 on every pass; UIKit then pixel-aligns the preferred size to 391.3333333 and compares it with the flow layout's float-stored 391.3333435, so no value on our side can make them agree.
Items are only self-sized along the scrolling axis, so CvLayout now overrides ShouldInvalidateLayout(preferred, original) and ignores cross-axis differences, with the same half-pixel tolerance the handler uses. Verified in PoolMath on the iPhone Duo simulator (iOS 27.2), without its app-side workaround: a cold launch while unfolded and a live fold/unfold both render the Timeline with no "stuck in its update loop".