Button icons centralised by default

This commit is contained in:
Robin 2015-12-04 20:13:20 +00:00
parent 55ecd42596
commit 466a9ec9d6

View File

@ -374,7 +374,7 @@ namespace DarkUI.Controls
{ {
var stringSize = g.MeasureString(Text, Font, rect.Size); var stringSize = g.MeasureString(Text, Font, rect.Size);
var x = 0; var x = (ClientSize.Width / 2) - (Image.Size.Width / 2);
var y = (ClientSize.Height / 2) - (Image.Size.Height / 2); var y = (ClientSize.Height / 2) - (Image.Size.Height / 2);
switch (TextImageRelation) switch (TextImageRelation)
@ -388,7 +388,8 @@ namespace DarkUI.Controls
y = y + ((int)(stringSize.Height / 2) + (ImagePadding / 2)); y = y + ((int)(stringSize.Height / 2) + (ImagePadding / 2));
break; break;
case TextImageRelation.ImageBeforeText: case TextImageRelation.ImageBeforeText:
textOffsetX = Image.Size.Width + ImagePadding; textOffsetX = Image.Size.Width + (ImagePadding * 2);
x = ImagePadding;
break; break;
case TextImageRelation.TextBeforeImage: case TextImageRelation.TextBeforeImage:
x = x + (int)stringSize.Width; x = x + (int)stringSize.Width;