-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
AdaptiveGridView fix when HorizontalAlignment is not stretch #1787
AdaptiveGridView fix when HorizontalAlignment is not stretch #1787
Conversation
…event to endlessly fire when the HorizontalAlignment is Center because the width is continually shrinking.
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.
Tiny issue with scrollbar padding now.
@@ -233,7 +233,7 @@ private void RecalculateLayout(double containerWidth) | |||
if (containerWidth > 0) | |||
{ | |||
var newWidth = CalculateItemWidth(containerWidth); | |||
ItemWidth = Math.Floor(newWidth - 1); | |||
ItemWidth = Math.Floor(newWidth); |
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.
Was this trying to prevent overlap or something? Do we need to adjust the left value of the next item?
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.
@nmetulev Any reason you had the -1
in there?
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.
We don't do any layout with this control. We just set the height and width of the GridViewItem controls through binding to ItemHeight and ItemWidth
@@ -233,7 +233,7 @@ private void RecalculateLayout(double containerWidth) | |||
if (containerWidth > 0) | |||
{ | |||
var newWidth = CalculateItemWidth(containerWidth); | |||
ItemWidth = Math.Floor(newWidth - 1); | |||
ItemWidth = Math.Floor(newWidth); |
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.
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.
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.
Good to know, I hadn't been paying as much attention to the overlap until this set of changes. :)
This PR is linked to unclosed issues. Please check if one of these issues should be closed: #1737 |
Issue: #1737
PR Type
What kind of change does this PR introduce?
What is the current behavior?
Application will crash when HorizontalAlignment is set to anything but stretch
PR Checklist
Please check if your PR fulfills the following requirements:
What is the new behavior?
Do not subtract one from the new width. This causes the SizeChanged event to endlessly fire when the HorizontalAlignment is not Stretch because the width is continually shrinking.
Does this PR introduce a breaking change?
Other information
Related to and caused by #1552