refactored a bit - something is still failing

This commit is contained in:
alzeih
2010-04-24 17:33:43 +12:00
parent 3d1d6f5e00
commit 471a5c29c8
12 changed files with 32 additions and 18 deletions

View File

@@ -86,13 +86,14 @@ namespace OpenRA.Widgets
base.Draw(world);
return;
}
var pos = DrawPosition();
var stateOffset = (Depressed) ? new int2(VisualHeight, VisualHeight) : new int2(0, 0);
WidgetUtils.DrawPanel(Depressed ? "dialog3" : "dialog2", new Rectangle(Bounds.X + getParentOffset().X, Bounds.Y + getParentOffset().Y, Bounds.Width, Bounds.Height ) );
WidgetUtils.DrawPanel(Depressed ? "dialog3" : "dialog2", new Rectangle(pos.X, pos.Y, Bounds.Width, Bounds.Height ) );
var text = GetText();
Game.chrome.renderer.BoldFont.DrawText(text,
new int2( ( Bounds.X + getParentOffset().X) + Bounds.Width / 2, ( Bounds.Y + getParentOffset().Y) + Bounds.Height / 2)
new int2( pos.X + Bounds.Width / 2, pos.Y + Bounds.Height / 2)
- new int2(Game.chrome.renderer.BoldFont.Measure(text).X / 2,
Game.chrome.renderer.BoldFont.Measure(text).Y / 2) + stateOffset, Color.White);