Empty text in middle column, textalign center

This commit is contained in:
2023-08-19 21:15:35 +02:00
parent f80e6009c3
commit 7878d3ad1c
2 changed files with 23 additions and 1 deletions

View File

@@ -90,6 +90,7 @@ public sealed partial class TextBlock<T> : View<TextBlock<T>, T>, IDisplayView
=> TextAlignment switch
{
TextAlignment.Right => string.Format($"{{0,{size.Width}}}", text),
TextAlignment.Center => string.Format($"{{0,{(size.Width - text.Length) / 2 + text.Length}}}", text),
_ => text
};