-
Notifications
You must be signed in to change notification settings - Fork 773
Partially Fixes #4522 - Stale ContentSize capture
#4863
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
Changes from all commits
7b6354f
59d52b3
fe9c184
ecb4cfd
5dd8ce8
fb93b73
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -721,6 +721,10 @@ internal void LayoutSubViews () | |||||||||
| Size contentSize = GetContentSize (); | ||||||||||
|
|
||||||||||
| OnSubViewLayout (new LayoutEventArgs (contentSize)); | ||||||||||
|
|
||||||||||
| // Re-read content size — OnSubViewLayout handlers (e.g. Dialog.UpdateSizes) may have called SetContentSize. | ||||||||||
| contentSize = GetContentSize (); | ||||||||||
|
|
||||||||||
| SubViewLayout?.Invoke (this, new LayoutEventArgs (contentSize)); | ||||||||||
|
|
||||||||||
|
||||||||||
| // Re-read content size — SubViewLayout handlers (e.g. LinearRange<T>) may have called SetContentSize. | |
| contentSize = GetContentSize (); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This change makes
SubViewLayout(and the laterSubViewsLaidOut) receive aLayoutEventArgswhoseOldContentSizemay already reflect a new value set byOnSubViewLayout. SinceLayoutEventArgs.OldContentSizeis documented as the content size before layout, consider capturing the original size into a separateoldContentSizevariable for the event args, while using a refreshed size variable purely for the layout computations (or update the event args/documentation to match the new semantics).