Vertically align labels

This commit is contained in:
Paul Chote
2010-07-10 21:38:47 +12:00
parent e063f5e271
commit dcf13e52c2
3 changed files with 13 additions and 13 deletions

View File

@@ -60,8 +60,8 @@ namespace OpenRA.Widgets
return;
int2 textSize = font.Measure(text);
int2 position = DrawPosition();
int2 position = DrawPosition() + new int2(0, (Bounds.Height - textSize.Y)/2);
if (Align == TextAlign.Center)
position += new int2((Bounds.Width - textSize.X)/2, 0);