From e5b6fccf67c61a4e8ac0789047ca3acbdfbcd25f Mon Sep 17 00:00:00 2001 From: Leo Date: Thu, 25 Feb 2021 07:39:53 -0300 Subject: [PATCH] Add a scroll speed property to ScrollContainer (#1590) Co-authored-by: Pieter-Jan Briers --- Robust.Client/UserInterface/Controls/ScrollContainer.cs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/Robust.Client/UserInterface/Controls/ScrollContainer.cs b/Robust.Client/UserInterface/Controls/ScrollContainer.cs index ccb75ff102..b9fbf0876d 100644 --- a/Robust.Client/UserInterface/Controls/ScrollContainer.cs +++ b/Robust.Client/UserInterface/Controls/ScrollContainer.cs @@ -17,6 +17,9 @@ namespace Robust.Client.UserInterface.Controls private bool _suppressScrollValueChanged; + public int ScrollSpeedX { get; set; } = 50; + public int ScrollSpeedY { get; set; } = 50; + public ScrollContainer() { MouseFilter = MouseFilterMode.Pass; @@ -197,12 +200,12 @@ namespace Robust.Client.UserInterface.Controls if (_vScrollEnabled) { - _vScrollBar.ValueTarget -= args.Delta.Y * 50; + _vScrollBar.ValueTarget -= args.Delta.Y * ScrollSpeedY; } if (_hScrollEnabled) { - _hScrollBar.ValueTarget += args.Delta.X * 50; + _hScrollBar.ValueTarget += args.Delta.X * ScrollSpeedX; } args.Handle();