-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
Fix incorrect caching of unconstrained measures #14373
Conversation
Thank you for your pull request. We are auto-formatting your source code to follow our code guidelines. |
/backport to net7.0 |
Started backporting to net7.0: https://github.com/dotnet/maui/actions/runs/4610212525 |
@mattleibow backporting to net7.0 failed, the patch most likely resulted in conflicts: $ git am --3way --ignore-whitespace --keep-non-patch changes.patch
Applying: Fix incorrect caching of unconstrained measures
.git/rebase-apply/patch:19: trailing whitespace.
.git/rebase-apply/patch:75: trailing whitespace.
.git/rebase-apply/patch:84: trailing whitespace.
warning: 3 lines add whitespace errors.
Using index info to reconstruct a base tree...
M src/Core/src/Platform/iOS/ContentView.cs
M src/Core/src/Platform/iOS/LayoutView.cs
M src/Core/src/Platform/iOS/MauiView.cs
M src/Core/src/PublicAPI/net-ios/PublicAPI.Unshipped.txt
M src/Core/src/PublicAPI/net-maccatalyst/PublicAPI.Unshipped.txt
Falling back to patching base and 3-way merge...
Auto-merging src/Core/src/PublicAPI/net-maccatalyst/PublicAPI.Unshipped.txt
CONFLICT (content): Merge conflict in src/Core/src/PublicAPI/net-maccatalyst/PublicAPI.Unshipped.txt
Auto-merging src/Core/src/PublicAPI/net-ios/PublicAPI.Unshipped.txt
CONFLICT (content): Merge conflict in src/Core/src/PublicAPI/net-ios/PublicAPI.Unshipped.txt
Auto-merging src/Core/src/Platform/iOS/MauiView.cs
CONFLICT (content): Merge conflict in src/Core/src/Platform/iOS/MauiView.cs
Auto-merging src/Core/src/Platform/iOS/LayoutView.cs
CONFLICT (content): Merge conflict in src/Core/src/Platform/iOS/LayoutView.cs
Auto-merging src/Core/src/Platform/iOS/ContentView.cs
CONFLICT (content): Merge conflict in src/Core/src/Platform/iOS/ContentView.cs
error: Failed to merge in the changes.
hint: Use 'git am --show-current-patch=diff' to see the failed patch
Patch failed at 0001 Fix incorrect caching of unconstrained measures
When you have resolved this problem, run "git am --continue".
If you prefer to skip this patch, run "git am --skip" instead.
To restore the original branch and stop patching, run "git am --abort".
Error: The process '/usr/bin/git' failed with exit code 128 Please backport manually! |
@mattleibow an error occurred while backporting to net7.0, please check the run log for details! Error: git am failed, most likely due to a merge conflict. |
Description of Change
The code to avoid re-measurement in the Layout and ContentView backing controls on iOS was treating re-measures with unconstrained height/width as being duplicate measures and not bothering to re-measure them. However, this is incompatible with the way ScollViews on iOS treat their content. This caused some combinations of layouts (mostly ScrollView at the root, with a Grid as the Content, though there may be others) to behave weirdly during resize operations (mostly visible on macOS/Catalyst when resizing the window).
This change treats re-measures at unconstrained height/width as being unequal to the previous measure, allowing the view to be measured again. It also consolidates the measure caching code from ContentView and LayoutView to reduce duplication.
This may technically re-introduce some unconstrained measurement calls which were avoided by #12627; we'll need to investigate further to see if some of those can be avoided in the future without breaking resizing situations.
Issues Fixed
Weird macOS resizing issues when hosting Grids inside of ScrollViews rooted at the Page level.