maui icon indicating copy to clipboard operation
maui copied to clipboard

Fix for FlexLayout padding issue

Open BagavathiPerumal opened this issue 1 year ago • 17 comments
trafficstars

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:

image

After fix:

image

BagavathiPerumal avatar Aug 13 '24 05:08 BagavathiPerumal

/azp run

jfversluis avatar Aug 13 '24 08:08 jfversluis

Azure Pipelines successfully started running 3 pipeline(s).

azure-pipelines[bot] avatar Aug 13 '24 08:08 azure-pipelines[bot]

/azp run

PureWeen avatar Aug 18 '24 17:08 PureWeen

Azure Pipelines successfully started running 3 pipeline(s).

azure-pipelines[bot] avatar Aug 18 '24 17:08 azure-pipelines[bot]

Azure Pipelines successfully started running 3 pipeline(s).

azure-pipelines[bot] avatar Aug 20 '24 08:08 azure-pipelines[bot]

Azure Pipelines successfully started running 3 pipeline(s).

azure-pipelines[bot] avatar Aug 20 '24 12:08 azure-pipelines[bot]

/azp run

PureWeen avatar Aug 20 '24 18:08 PureWeen

Azure Pipelines successfully started running 3 pipeline(s).

azure-pipelines[bot] avatar Aug 20 '24 18:08 azure-pipelines[bot]

/azp run

Redth avatar Aug 22 '24 16:08 Redth

Azure Pipelines successfully started running 3 pipeline(s).

azure-pipelines[bot] avatar Aug 22 '24 16:08 azure-pipelines[bot]

/azp run

PureWeen avatar Aug 23 '24 15:08 PureWeen

Azure Pipelines successfully started running 3 pipeline(s).

azure-pipelines[bot] avatar Aug 23 '24 15:08 azure-pipelines[bot]

/azp run

PureWeen avatar Aug 26 '24 14:08 PureWeen

Azure Pipelines successfully started running 3 pipeline(s).

azure-pipelines[bot] avatar Aug 26 '24 14:08 azure-pipelines[bot]

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

BagavathiPerumal avatar Aug 26 '24 15:08 BagavathiPerumal

/azp run

PureWeen avatar Aug 28 '24 19:08 PureWeen

Azure Pipelines successfully started running 3 pipeline(s).

azure-pipelines[bot] avatar Aug 28 '24 19:08 azure-pipelines[bot]

/azp run

PureWeen avatar Aug 29 '24 16:08 PureWeen

Azure Pipelines successfully started running 3 pipeline(s).

azure-pipelines[bot] avatar Aug 29 '24 16:08 azure-pipelines[bot]