-
-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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 aligned to top instead of center when changing LineHeight on TextBlock. #13873
Comments
What can I do to help with this ticket? It's a pretty glaring issue in our application and I'd rather not do some sort of hack (like manual offsets of the text) |
You can reach out to the team in case you have a support agreement. |
LineHeight should be distributed evenly now. Are you sure this is still an issue? |
@Gillibald When was this fixed? I don't see a PR attached to this ticket and I wasn't able to find anything in the changelog about it. We're using the latest version of Avalonia and haven't seen any change to the line height |
Thanks for the fix! Really appreciate it! |
Describe the bug
When changing the
LineHeight
orHeight
properties of aTextBlock
, the text stays at a fixed distance from the top of the control, rather than being centered.This causes both vertical text alignment problems as well as text clipping problems at lower line heights.
To Reproduce
Steps to reproduce the behavior:
Code sample:
Expected Behaviour
The text should be placed in the center of the available height, not at a fixed distance from the top.
This is to avoid alignment issues as well as potential clipping issues at lower
LineHeight
values (e.g. 120%)This is how the line-height behaves for normal CSS, and how I would expect Avalonia to work as well:

Environment
The text was updated successfully, but these errors were encountered: