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

UniformGrid layout rounding is incorrect #17699

Open
grokys opened this issue Dec 5, 2024 · 0 comments
Open

UniformGrid layout rounding is incorrect #17699

grokys opened this issue Dec 5, 2024 · 0 comments
Assignees
Labels
bug customer-priority Issue reported by a customer with a support agreement.

Comments

@grokys
Copy link
Member

grokys commented Dec 5, 2024

Describe the bug

When running on a 125% scaling monitor, the children of UniformGrid can overlap. Setting UseLayoutRounding="False" fixes it.

To Reproduce

<Border Width="100" Height="100">
  <UniformGrid Columns="2">
    <Border Background="White" BorderBrush="Red" BorderThickness="0,0,1,1"/>
    <Border Background="White" BorderBrush="Green" BorderThickness="0,0,1,1"/>
  </UniformGrid>
</Border>

Expected behavior

The children should be laid out to be next to each other, not overlapping.

Avalonia version

all

OS

No response

Additional context

This is because UniformGrid is a direct port from WPF and WPF's layout rounding is subtly different to that of Avalonia.

@grokys grokys added bug customer-priority Issue reported by a customer with a support agreement. labels Dec 5, 2024
@grokys grokys self-assigned this Dec 5, 2024
grokys added a commit that referenced this issue Dec 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug customer-priority Issue reported by a customer with a support agreement.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant