AvaloniaUI / Avalonia

Develop Desktop, Embedded, Mobile and WebAssembly apps with C# and XAML. The most popular .NET UI client technology
https://avaloniaui.net
MIT License
25.71k stars 2.22k forks source link

TextBlock render position error in `11.2.0` #17396

Open Coloryr opened 3 hours ago

Coloryr commented 3 hours ago

Describe the bug

TextBox render text position deviate. At 11.2.0 image At 11.1.4 image

To Reproduce

  1. Add a textblock
  2. Add text
  3. Use 11.2.0

Expected behavior

Same with 11.1.4

Avalonia version

11.2.0

OS

Windows

Additional context

No response

Coloryr commented 3 hours ago

The TextBlock

<TextBlock
    HorizontalAlignment="Center"
    FontSize="13"
    Text="{Binding Name, FallbackValue=1234}"
    TextAlignment="Center"
    TextTrimming="{Binding Trim}"
    TextWrapping="{Binding Wrap}" />

When

 HorizontalAlignment="Center"

will render in error position, delete it or set Left is work.

Coloryr commented 3 hours ago

HorizontalAlignment and TextAlignment cannot be set the same Center