Skip to content

Commit

Permalink
Update widget mouseover when scrolling panels.
Browse files Browse the repository at this point in the history
  • Loading branch information
pchote committed Apr 29, 2015
1 parent ea679d4 commit cd12dcc
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions OpenRA.Mods.Common/Widgets/ScrollPanelWidget.cs
Expand Up @@ -73,7 +73,13 @@ protected void SetListOffset(float value, bool smooth)
{
targetListOffset = value;
if (!smooth)
{
currentListOffset = value;

// Update mouseover
var mi = new MouseInput(MouseInputEvent.Move, MouseButton.None, 0, Viewport.LastMousePos, Modifiers.None, 0);
Ui.HandleInput(mi);
}
}

[ObjectCreator.UseCtor]
Expand Down Expand Up @@ -235,7 +241,13 @@ public override void Tick()
var offsetDiff = targetListOffset - currentListOffset;
var absOffsetDiff = Math.Abs(offsetDiff);
if (absOffsetDiff > 1f)
{
currentListOffset += offsetDiff * SmoothScrollSpeed.Clamp(0.1f, 1.0f);

// Update mouseover
var mi = new MouseInput(MouseInputEvent.Move, MouseButton.None, 0, Viewport.LastMousePos, Modifiers.None, 0);
Ui.HandleInput(mi);
}
else
SetListOffset(targetListOffset, false);
}
Expand Down

0 comments on commit cd12dcc

Please sign in to comment.