diff --git a/AngelLoader/CustomControls/RichTextBoxCustom/Workarounds.cs b/AngelLoader/CustomControls/RichTextBoxCustom/Workarounds.cs index a134e4328..b62780b69 100644 --- a/AngelLoader/CustomControls/RichTextBoxCustom/Workarounds.cs +++ b/AngelLoader/CustomControls/RichTextBoxCustom/Workarounds.cs @@ -20,6 +20,7 @@ internal sealed partial class RichTextBoxCustom // No picture is used currently private PictureBox pbGlyph; private bool endOnMouseUp; + private int WheelAccum; #endregion @@ -80,6 +81,7 @@ protected override void OnVScroll(EventArgs e) protected override async void OnEnter(EventArgs e) { + WheelAccum = 0; await SetScrollPositionToCorrect(); base.OnEnter(e); @@ -144,8 +146,21 @@ private void InterceptMousewheel(ref Message m) return; } - int delta = (int)m.WParam; - if (delta != 0) BetterScroll(m.HWnd, delta < 0 ? 50 : -50); + int delta = 120; + WheelAccum += (int)m.WParam >> 16; + if (Math.Abs(WheelAccum) >= delta) + { + while (WheelAccum >= delta) + { + BetterScroll(m.HWnd, -50); + WheelAccum -= delta; + } + while (WheelAccum <= -delta) + { + BetterScroll(m.HWnd, 50); + WheelAccum += delta; + } + } } #endregion