-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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 for FlexLayout padding issue #24195
Conversation
…alculation in the Measure and ArrangeChildren method().
/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). |
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.
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
public class FlexLayoutTests |
/azp run |
Azure Pipelines successfully started running 3 pipeline(s). |
@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). |
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.
Failing test not related
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 #15991
Reference:
Referred code changes from HorizontalStackLayoutManager.cs file.
maui/src/Core/src/Layouts/HorizontalStackLayoutManager.cs
Line 12 in 210bc35
Output
Before fix:
After fix: