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

Fix bug with UniformGridLayout MaximumRowsOrColumns and requested size #1802

Conversation

marcelwgn
Copy link
Collaborator

Description

Fix bug where the UniformGridLayout would ignore thefact that it only renders a certain amount of columns/rows and then request the whole width/height instead of requesting what is needed.

Motivation and Context

Fixes #1549

How Has This Been Tested?

Added new API test.

Screenshots (if appropriate):

@msft-github-bot msft-github-bot added the needs-triage Issue needs to be triaged by the area owners label Jan 2, 2020
@ranjeshj
Copy link
Contributor

ranjeshj commented Jan 2, 2020

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

availableSizeMinor :
std::max(0.0f, itemsCount * GetMinorSizeWithSpacing(context) - static_cast<float>(MinItemSpacing()));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FlowLayout likely has the same issue as well.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I just looked at FlowLayout(Algorithm).cpp and it didn't seem like that the same issue was also present there.

@ranjeshj ranjeshj added area-ItemsRepeater team-Controls Issue for the Controls team and removed needs-triage Issue needs to be triaged by the area owners labels Jan 2, 2020
availableSizeMinor :
std::max(0.0f, itemsCount * GetMinorSizeWithSpacing(context) - static_cast<float>(MinItemSpacing()));
std::max(0.0f, itemsPerLine * GetMinorSizeWithSpacing(context) - static_cast<float>(MinItemSpacing()));
Copy link
Contributor

@StephenLPeters StephenLPeters Jan 2, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

0.0f [](start = 21, length = 4)

Should this be capped to availableSizeMinor? @ranjeshj

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is correct. If there are any items present, we should size the extent based on the item sizes irrespective of what the available size that was provided by the parent.


In reply to: 362570947 [](ancestors = 362570947)

Copy link
Contributor

@StephenLPeters StephenLPeters left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:shipit:

@StephenLPeters StephenLPeters merged commit 007ab33 into microsoft:master Jan 2, 2020
ranjeshj pushed a commit that referenced this pull request Feb 4, 2020
#1802)

* Add test for UniformGridLayout measure bug

* Update test so it actually tests #1549

* Fix bug with stretching of UniformGridLayout when it should not

* Fix indentation
ranjeshj pushed a commit that referenced this pull request Feb 9, 2020
#1802)

* Add test for UniformGridLayout measure bug

* Update test so it actually tests #1549

* Fix bug with stretching of UniformGridLayout when it should not

* Fix indentation
@msft-github-bot
Copy link
Collaborator

🎉Microsoft.UI.Xaml v2.4.0 has been released which incorporates this pull request.:tada:

Handy links:

@marcelwgn marcelwgn deleted the uniformgridlayout-measureoverride-correction branch May 15, 2020 14:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-ItemsRepeater team-Controls Issue for the Controls team
Projects
None yet
Development

Successfully merging this pull request may close these issues.

UniformGridLayout reports the wrong size during measure override
4 participants