提交 cb8ddb11 编写于 作者: D David Rolland

Corrected bug #1437. Corrected the cast of two short values from an lParam....

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.
上级 a8cb5c39
......@@ -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 );
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册