picoe / Eto

Cross platform GUI framework for desktop and mobile applications in .NET
Other
3.67k stars 333 forks source link

MouseWheel Bug with Win32 SignedHIWORD #200

Closed bchavez closed 10 years ago

bchavez commented 10 years ago

Hi there,

There appears to be a problem with the Win32:Util.SignedHIWORD() conversion function:

https://github.com/picoe/Eto/blob/develop/Source/Eto.Platform.Windows/Win32.cs#L124

Specifically,

     public static int SignedHIWORD (int n) { return (n >> 16 & 65535); }
     public static int SignedLOWORD (int n) { return (n & 65535); }

should be:

     public static int SignedHIWORD (int n) { return (short)(n >> 16 & 65535); }
     public static int SignedLOWORD (int n) { return (short)(n & 65535); }

Otherwise, negative numbers (like moving the mouse wheel in the negative direction) fails to get converted to a negative number. Currently, all mouse wheel movements in Eto.Forms.Windows are positive numbers.. mainly 1 and 545.1334

cwensley commented 10 years ago

Fixed with PR #200