Make ButtonWidget cheaper
This commit is contained in:
@@ -120,12 +120,14 @@ namespace OpenRA.Widgets
|
|||||||
var stateOffset = (Depressed) ? new int2(VisualHeight, VisualHeight) : new int2(0, 0);
|
var stateOffset = (Depressed) ? new int2(VisualHeight, VisualHeight) : new int2(0, 0);
|
||||||
|
|
||||||
var image = ChromeProvider.GetImage("scrollbar", "down_arrow");
|
var image = ChromeProvider.GetImage("scrollbar", "down_arrow");
|
||||||
|
var rb = RenderBounds;
|
||||||
|
|
||||||
WidgetUtils.DrawRGBA( image,
|
WidgetUtils.DrawRGBA( image,
|
||||||
stateOffset + new float2( RenderBounds.Right - RenderBounds.Height + 4,
|
stateOffset + new float2( rb.Right - rb.Height + 4,
|
||||||
RenderBounds.Top + (RenderBounds.Height - image.bounds.Height) / 2 ));
|
rb.Top + (rb.Height - image.bounds.Height) / 2 ));
|
||||||
|
|
||||||
WidgetUtils.FillRectWithColor(new Rectangle(stateOffset.X + RenderBounds.Right - RenderBounds.Height,
|
WidgetUtils.FillRectWithColor(new Rectangle(stateOffset.X + rb.Right - rb.Height,
|
||||||
stateOffset.Y + RenderBounds.Top + 3, 1, RenderBounds.Height - 6),
|
stateOffset.Y + rb.Top + 3, 1, rb.Height - 6),
|
||||||
Color.White);
|
Color.White);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user