AvaloniaUI/Avalonia

UniformGrid layout rounding is incorrect

grokys opened this issue · 0 comments

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.