Allow custom BorderWidths on ScrollPanelWidget.

This commit is contained in:
Paul Chote
2016-05-29 00:36:29 +01:00
parent 90468974ce
commit 67d6de91e3

View File

@@ -34,6 +34,7 @@ namespace OpenRA.Mods.Common.Widgets
{
readonly Ruleset modRules;
public int ScrollbarWidth = 24;
public int BorderWidth = 1;
public int TopBottomSpacing = 2;
public int ItemSpacing = 0;
public int ButtonDepth = ChromeMetrics.Get<int>("ButtonDepth");
@@ -165,7 +166,7 @@ namespace OpenRA.Mods.Common.Widgets
WidgetUtils.DrawRGBA(ChromeProvider.GetImage("scrollbar", downPressed || downDisabled ? "down_pressed" : "down_arrow"),
new float2(downButtonRect.Left + downOffset, downButtonRect.Top + downOffset));
var drawBounds = backgroundRect.InflateBy(-1, -1, -1, -1);
var drawBounds = backgroundRect.InflateBy(-BorderWidth, -BorderWidth, -BorderWidth, -BorderWidth);
Game.Renderer.EnableScissor(drawBounds);
drawBounds.Offset((-ChildOrigin).ToPoint());