maui
maui copied to clipboard
Fix for FlexLayout padding issue
Root cause
The FlexLayout doesn't include the padding value during its arrangement and measurement processes. As a result, the padding is not applied in the FlexLayout.
Description of Issue Fix
The fix involves updating the layout arrangement to include padding values, adjust bounds, and arrange children accordingly. The measurement process is adjusted to exclude padding during measurement, then add it back to determine the final size. This ensures accurate layout and measurement with proper padding.
Issues Fixed
Fixes https://github.com/dotnet/maui/issues/15991
Reference:
Referred code changes from HorizontalStackLayoutManager.cs file.
https://github.com/dotnet/maui/blob/210bc3581a8033cbbcbb14da931833c68c85583e/src/Core/src/Layouts/HorizontalStackLayoutManager.cs#L12
Output
Before fix:
After fix:
/azp run
Azure Pipelines successfully started running 3 pipeline(s).
/azp run
Azure Pipelines successfully started running 3 pipeline(s).
Azure Pipelines successfully started running 3 pipeline(s).
Azure Pipelines successfully started running 3 pipeline(s).
/azp run
Azure Pipelines successfully started running 3 pipeline(s).
/azp run
Azure Pipelines successfully started running 3 pipeline(s).
/azp run
Azure Pipelines successfully started running 3 pipeline(s).
/azp run
Azure Pipelines successfully started running 3 pipeline(s).
For this one, instead of doing a screenshot test can we move these tests to the "UnitTests" ?
Since none of the changes in here depend on anything platformspecific?
Here's an example of some tests against the new FlexLayout
https://github.com/dotnet/maui/blob/c1566589d1794e5adcbcf2e93bd77fc85f859253/src/Controls/tests/Core.UnitTests/Layouts/FlexLayoutTests.cs#L11
@PureWeen I have updated the tests to Unit Tests, could you please validate once and let me know if there is any concerns
/azp run
Azure Pipelines successfully started running 3 pipeline(s).
/azp run
Azure Pipelines successfully started running 3 pipeline(s).