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

DataGridColumn - fix LayoutRoundedWidth with DPI scaling applied #6860

Merged
merged 3 commits into from
Dec 7, 2021

Conversation

ltetak
Copy link
Contributor

@ltetak ltetak commented Nov 4, 2021

What does the pull request do?

Fixes LayoutRoundedWidth for DPI scaling other than 1.

What is the current behavior?

The current calculation does not account for DPI scaling and produces artifacts, especially with header borders.
repro steps

  1. change your DPI scaling to 125% (or other than 100%)
  2. in the Avalonia Sample app Data grid page resize the window or columns
  3. Vertical separator lines will randomly disappear
    image

What is the updated/expected behavior with this PR?

Vertical separator lines should be visible at all times.
Interestingly cells calculation is different (because it is visual). But I believe now it will be the same.

How was the solution implemented (if it's not obvious)?

I don't know this code very well but I used the same layout rounding as other visuals and it seems to work just well enough.

@maxkatz6 maxkatz6 merged commit d5e8a1c into AvaloniaUI:master Dec 7, 2021
danwalmsley pushed a commit that referenced this pull request Dec 7, 2021
DataGridColumn - fix LayoutRoundedWidth with DPI scaling applied
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants