Skip to content

Commit

Permalink
Fixed an overflow exception when extracting delta from mouse horizont…
Browse files Browse the repository at this point in the history
…al wheel native event.
  • Loading branch information
rvuistin committed Jun 13, 2016
1 parent 6eef7d2 commit c13e2c0
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions Lib/Windows/Input/MouseWheel/MouseWheelController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -209,9 +209,9 @@ private IntPtr MouseHorizontalWheelHook(IntPtr hwnd, int msg, IntPt
{
var timestamp = Environment.TickCount;
var originalSource = Mouse.DirectlyOver;
var delta = wParam.ToInt32 () >> 16;
var ie = new MouseWheelInputEventArgs (this, MouseWheel.Current, timestamp, -delta, Orientation.Horizontal);
OnPreviewMouseWheel (originalSource, ie);
var delta = (short)unchecked((uint)(long)wParam >> 16);
var ie = new MouseWheelInputEventArgs(this, MouseWheel.Current, timestamp, -delta, Orientation.Horizontal);
OnPreviewMouseWheel(originalSource, ie);
break;
}
}
Expand Down

0 comments on commit c13e2c0

Please sign in to comment.