Skip to content

[ASDisplayNode] Stop infinite layout in _u_measureNodeWithBoundsIfNecessary#1434

Merged
nguyenhuy merged 1 commit intoTextureGroup:masterfrom
rcancro:layoutLoop
Apr 1, 2019
Merged

[ASDisplayNode] Stop infinite layout in _u_measureNodeWithBoundsIfNecessary#1434
nguyenhuy merged 1 commit intoTextureGroup:masterfrom
rcancro:layoutLoop

Conversation

@rcancro
Copy link
Contributor

@rcancro rcancro commented Mar 29, 2019

We came across an infinite layout loop in _u_measureNodeWithBoundsIfNecessary. After requesting a layout from above, the sizes between pending and caluclated layout still do not match. We continue to prefer to use the pending layout and ask for another layout loop from above. We can’t seem to break out of this loop. The solution (thanks to Huy for the guidance) was to nil out the pending layout we get from requesting the layout from above.

I was only able to reproduce this when working with a node in a UINavigationBarItem’s titleView. I think that UIKit must be doing something sneaky with setting the frame on the view. While I was not able to create a unit test to catch this issue (I tried for a long time, and can post what I’ve come up with to see if anyone has any suggestions), I was able to create a pretty simple example project that shows the behavior:
https://github.com/rcancro/TextureLayoutLoopExample

Loading
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.

4 participants