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

Adjust layout for higher DPI #1845

Merged
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,9 @@ protected virtual double CalculateItemWidth(double containerWidth)
return DesiredWidth;
}

var info = Windows.Graphics.Display.DisplayInformation.GetForCurrentView();
containerWidth = containerWidth - (1 * info.RawPixelsPerViewPixel);

var columns = CalculateColumns(containerWidth, DesiredWidth);

// If there's less items than there's columns, reduce the column count (if requested);
Expand Down Expand Up @@ -264,9 +267,7 @@ private void RecalculateLayout(double containerWidth)
if (containerWidth > 0)
{
var newWidth = CalculateItemWidth(containerWidth);

// Need to subtract one here for #1803 to not fight internal panel layout with odd DPI multiple (e.g. 125%)
ItemWidth = Math.Max(Math.Floor(newWidth) - 1, 0);
ItemWidth = Math.Floor(newWidth);
}
}
}
Expand Down