Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AutoSize calculations can sometimes never reach a stable state #3785

Open
smoogipoo opened this issue Aug 4, 2020 · 1 comment
Open

AutoSize calculations can sometimes never reach a stable state #3785

smoogipoo opened this issue Aug 4, 2020 · 1 comment

Comments

@smoogipoo
Copy link
Contributor

Very easy to replicate with the results screen statistics in lazer: https://drive.google.com/file/d/14bpey-ofUjQGTJJSTeE6nysUIdrOgoh0/view?usp=sharing

Possibly due to FP precision loss, autosize probably shouldn't consider changes in size by such small amounts.

@EVAST9919
Copy link
Contributor

I've stumbled upon a similar (same?) issue with autosized FillFlowContainers and it indeed looks like a precision issue somewhere. In this case parent's autosize depends on children positions and their position depends on size of the parent.
Here's the flow of events:

  1. flow layout isn't valid, call PerformLayout
  2. this will invalidate childrenSizeDependencies in CompositeDrawable (which FlowContainer is)
  3. computing autosize will perform Invalidation.DrawSize and invalidate flow layout
  4. call PerformLayout again, now children have slightly different positions
  5. autosize will be calculated a bit differently and so are the children positions later

And we are stuck in this loop until we reach the stable state which may or may not happen. Stable state is being reached by praying that all the children won't have different positions calculated while performing layout after autosize (step 4).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants