Commit 24333569 authored by Adi Shavit's avatar Adi Shavit

Small fixes: typo, spacing and using ::ScreenToClient() instead of ::GetWindowRect()

parent e45cf217
...@@ -76,9 +76,9 @@ enum { EVENT_MOUSEMOVE = 0, ...@@ -76,9 +76,9 @@ enum { EVENT_MOUSEMOVE = 0,
EVENT_MBUTTONUP = 6, EVENT_MBUTTONUP = 6,
EVENT_LBUTTONDBLCLK = 7, EVENT_LBUTTONDBLCLK = 7,
EVENT_RBUTTONDBLCLK = 8, EVENT_RBUTTONDBLCLK = 8,
EVENT_MBUTTONDBLCLK =9, EVENT_MBUTTONDBLCLK = 9,
EVENT_MOUSEWHEEL =10, EVENT_MOUSEWHEEL = 10,
EVENT_MOUSEHWHEEL =11 EVENT_MOUSEHWHEEL = 11
}; };
enum { EVENT_FLAG_LBUTTON = 1, enum { EVENT_FLAG_LBUTTON = 1,
......
...@@ -40,7 +40,7 @@ ...@@ -40,7 +40,7 @@
//M*/ //M*/
#include "precomp.hpp" #include "precomp.hpp"
#include <windowsx.h> // required for GET_X_LPARAM() and GET_Y_LPARAM() marco #include <windowsx.h> // required for GET_X_LPARAM() and GET_Y_LPARAM() macros
#if defined WIN32 || defined _WIN32 #if defined WIN32 || defined _WIN32
...@@ -1395,13 +1395,9 @@ MainWindowProc( HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam ) ...@@ -1395,13 +1395,9 @@ MainWindowProc( HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam )
flags |= (delta << 16); flags |= (delta << 16);
POINT pt; POINT pt;
{ pt.x = GET_X_LPARAM( lParam );
// since The coordinates are relative to screen so get screen size. pt.y = GET_Y_LPARAM( lParam );
RECT windowRect; ::ScreenToClient(hwnd, &pt); // Convert screen coordinates to client coordinates.
::GetWindowRect( window->hwnd, &windowRect );
pt.x = GET_X_LPARAM( lParam ) - windowRect.left;
pt.y = GET_Y_LPARAM( lParam ) - windowRect.top;
}
RECT rect; RECT rect;
GetClientRect( window->hwnd, &rect ); GetClientRect( window->hwnd, &rect );
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment