Corrected bug #1437. Corrected the cast of two short values from an lParam. lParam contains two signed-short, the position can be negative when another mouse event happens with a mouse_move (mouse_click, etc.)

The Microsoft documentation specifies NOT to use LOWORD and HIWORD macros to extract the x/y positions as it won't work correctly with multiple monitors. See http://msdn.microsoft.com/en-us/library/windows/desktop/ms645607(v=vs.85).aspx.
This commit is contained in:
David Rolland 2014-04-06 21:32:01 +12:00
parent a8cb5c3983
commit cb8ddb1179

View File

@ -52,6 +52,7 @@
#include <string.h>
#include <stdio.h>
#include <assert.h>
#include <windowsx.h>
#ifdef HAVE_OPENGL
#include <memory>
@ -1459,8 +1460,8 @@ static LRESULT CALLBACK HighGUIProc( HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM
if( uMsg == WM_LBUTTONUP || uMsg == WM_RBUTTONUP || uMsg == WM_MBUTTONUP )
ReleaseCapture();
pt.x = LOWORD( lParam );
pt.y = HIWORD( lParam );
pt.x = GET_X_LPARAM( lParam );
pt.y = GET_Y_LPARAM( lParam );
GetClientRect( window->hwnd, &rect );
icvGetBitmapData( window, &size, 0, 0 );