diff --git a/OpenRA.Mods.Common/Widgets/ScrollPanelWidget.cs b/OpenRA.Mods.Common/Widgets/ScrollPanelWidget.cs index 7bb070b9fe..ea461afc1e 100644 --- a/OpenRA.Mods.Common/Widgets/ScrollPanelWidget.cs +++ b/OpenRA.Mods.Common/Widgets/ScrollPanelWidget.cs @@ -146,13 +146,16 @@ namespace OpenRA.Mods.Common.Widgets UpdateSmoothScrolling(); var rb = RenderBounds; - var scrollbarHeight = rb.Height - 2 * ScrollbarWidth; - var thumbHeight = ContentHeight == 0 ? 0 : Math.Max(MinimumThumbSize, (int)(scrollbarHeight * Math.Min(rb.Height * 1f / ContentHeight, 1f))); - var thumbOrigin = rb.Y + ScrollbarWidth + (int)((scrollbarHeight - thumbHeight) * (-1f * currentListOffset / (ContentHeight - rb.Height))); - if (thumbHeight == scrollbarHeight) - thumbHeight = 0; + // Scroll thumb is only visible if the content does not fit within the panel bounds + var thumbHeight = 0; + var thumbOrigin = rb.Y + ScrollbarWidth; + if (ContentHeight > rb.Height) + { + thumbHeight = Math.Max(MinimumThumbSize, scrollbarHeight * rb.Height / ContentHeight); + thumbOrigin += (int)((scrollbarHeight - thumbHeight) * currentListOffset / (rb.Height - ContentHeight)); + } switch (ScrollBar) {