Skip to content

Commit

Permalink
Merge pull request #14 from Xanfre/master
Browse files Browse the repository at this point in the history
Optimize new scrolling for high-resolution mouse wheels and trackpads
  • Loading branch information
FenPhoenix authored May 9, 2019
2 parents 4ab59a8 + 815793b commit 9441599
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions AngelLoader/CustomControls/RichTextBoxCustom.cs
Original file line number Diff line number Diff line change
Expand Up @@ -382,17 +382,16 @@ private static void RepositionScroll(IntPtr handle, SCROLLINFO si)
// Intercept mousewheel and make RichTextBox scroll using the above method
private void InterceptMousewheel(ref Message m)
{
int delta = (int)m.WParam >> 16 & 0xFF;
if (((ModifierKeys & Keys.Control) != 0) || !VerticalScrollBarVisible(this))
{
base.WndProc(ref m);
return;
}
if ((delta >> 7) == 1)
if ((int)m.WParam < 0)
{
BetterScroll(m.HWnd, 50);
}
if ((delta >> 7) == 0)
if ((int)m.WParam > 0)
{
BetterScroll(m.HWnd, -50);
}
Expand Down

0 comments on commit 9441599

Please sign in to comment.