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

Ensure that second-pass measures of Auto rows/columns are allowed to expand #14315

Merged
merged 2 commits into from
Mar 31, 2023

Conversation

hartez
Copy link
Contributor

@hartez hartez commented Mar 31, 2023

Description of Change

In situations where the Grid is forced to do a second measure pass to resolve Star values which intersect with Auto values, the measurement in the alternate axis was being constrained to the size of the items measured in the first pass. This especially causes problems for Labels, which are more likely to measure taller when their width is constrained on the second pass.

These changes ensure that Auto values are recognized when doing the second measure pass.

Issues Fixed

Fixes #14296
Fixes #14991

@github-actions
Copy link
Contributor

Thank you for your pull request. We are auto-formatting your source code to follow our code guidelines.

@rmarinho
Copy link
Member

Is there a workaround ?

@rmarinho rmarinho added the backport/suggested The PR author or issue review has suggested that the change should be backported. label Mar 31, 2023
@hartez
Copy link
Contributor Author

hartez commented Mar 31, 2023

Is there a workaround ?

To the PR?

@Eilon Eilon added the area-layout StackLayout, GridLayout, ContentView, AbsoluteLayout, FlexLayout, ContentPresenter label Mar 31, 2023
@mattleibow mattleibow merged commit 5083a24 into main Mar 31, 2023
@mattleibow mattleibow deleted the fix-14296 branch March 31, 2023 22:12
@mattleibow
Copy link
Member

/backport to net7.0

@github-actions
Copy link
Contributor

Started backporting to net7.0: https://github.com/dotnet/maui/actions/runs/4579577198

@github-actions
Copy link
Contributor

@mattleibow backporting to net7.0 failed, the patch most likely resulted in conflicts:

$ git am --3way --ignore-whitespace --keep-non-patch changes.patch

Applying: Ensure that second-pass measures of Auto rows/columns are allowed to expand Fixes #14296
.git/rebase-apply/patch:101: trailing whitespace.
		// These next two tests validate cases where the Grid structure necessitates multiple 
.git/rebase-apply/patch:108: trailing whitespace.
		public void AutoRowIsDominatedByTallestView(double unconstrainedHeight, double constrainedHeight) 
warning: 2 lines add whitespace errors.
Using index info to reconstruct a base tree...
M	src/Core/src/Layouts/GridLayoutManager.cs
M	src/Core/tests/UnitTests/Layouts/GridLayoutManagerTests.cs
Falling back to patching base and 3-way merge...
Auto-merging src/Core/tests/UnitTests/Layouts/GridLayoutManagerTests.cs
CONFLICT (content): Merge conflict in src/Core/tests/UnitTests/Layouts/GridLayoutManagerTests.cs
Auto-merging src/Core/src/Layouts/GridLayoutManager.cs
CONFLICT (content): Merge conflict in src/Core/src/Layouts/GridLayoutManager.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 Ensure that second-pass measures of Auto rows/columns are allowed to expand Fixes #14296
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!

@github-actions
Copy link
Contributor

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

hartez added a commit that referenced this pull request Mar 31, 2023
rmarinho pushed a commit that referenced this pull request Apr 3, 2023
…expand (#14315)

Fixes #14296
# Conflicts:
#	src/Core/src/Layouts/GridLayoutManager.cs
rmarinho pushed a commit that referenced this pull request Apr 11, 2023
)

* Fix edge case with Grids, *s, and unconstrained layouts

* Auto-format source code

* Ensure that second-pass measures of Auto rows/columns are allowed to expand (#14315)

Fixes #14296
# Conflicts:
#	src/Core/src/Layouts/GridLayoutManager.cs

---------

Co-authored-by: E.Z. Hart <hartez@gmail.com>
Co-authored-by: GitHub Actions Autoformatter <autoformat@example.com>
Co-authored-by: E.Z. Hart <hartez@users.noreply.github.com>
@hartez hartez added the backport/approved After some discussion or review, this PR or change was approved to be backported. label May 31, 2023
@github-actions github-actions bot locked and limited conversation to collaborators Dec 12, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-layout StackLayout, GridLayout, ContentView, AbsoluteLayout, FlexLayout, ContentPresenter backport/approved After some discussion or review, this PR or change was approved to be backported. backport/suggested The PR author or issue review has suggested that the change should be backported.
Projects
None yet
4 participants