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

Text Block displays incorrect TextAlignment after changing property #18130

Open
renrutsirhc opened this issue Feb 5, 2025 · 2 comments
Open

Comments

@renrutsirhc
Copy link

Describe the bug

A Text Block with TextAlignment set to Center/Right (possibly others) can get into a state where although the TextBlock's TextAlignment property is still set correctly, the visual appearance of the TextBlock is TextAlignment left. This seems to happen only in certain cases:

Screen.Recording.2025-02-06.083019.mp4

To Reproduce

  • TextBlock with TextAlignment set to Right and FontFamily bound to Font on the VM
  • ComboBox with SelectedItem Bound to Font on VM
  • Change the font using the combobox
  • Observe change of visual TextAlignment

Minimal repro: TextAlignmentRepro.zip

Expected behavior

TextBlock should display it's text aligned correctly.

Avalonia version

11.2.3

OS

Windows

Additional context

No response

@timunie
Copy link
Contributor

timunie commented Feb 6, 2025

Nightly reproduces this issue. After resizing the window the text is rendered as it should be.

@renrutsirhc
Copy link
Author

After being incorrectly rendered, the text also gets rendered as it should be if you change the FontWeight or change the TextAlignment properties.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants