From af48626020bf0bc87c8a8ff9b56950e6e1a8c847 Mon Sep 17 00:00:00 2001 From: Pavlos Touboulidis Date: Sat, 26 Apr 2014 17:21:42 +0300 Subject: [PATCH] Fix scroll offsets This is not a full fix, it merely restores the functionality already present. The ScrollPanelWidget does not work right if Align is set to Bottom but ScrollToBottom() isn't called after adding items and there's not enough content to scroll. --- OpenRA.Game/Widgets/ScrollPanelWidget.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/OpenRA.Game/Widgets/ScrollPanelWidget.cs b/OpenRA.Game/Widgets/ScrollPanelWidget.cs index b5c8be5fa2..e0e04bac3f 100644 --- a/OpenRA.Game/Widgets/ScrollPanelWidget.cs +++ b/OpenRA.Game/Widgets/ScrollPanelWidget.cs @@ -151,7 +151,7 @@ namespace OpenRA.Widgets public bool ScrolledToBottom { - get { return ListOffset == Math.Min(0, Bounds.Height - ContentHeight); } + get { return ListOffset == Math.Min(0, Bounds.Height - ContentHeight) || ContentHeight <= Bounds.Height; } } public void ScrollToItem(string itemKey)