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,
EVENT_MBUTTONUP = 6,
EVENT_LBUTTONDBLCLK = 7,
EVENT_RBUTTONDBLCLK = 8,
EVENT_MBUTTONDBLCLK =9,
EVENT_MOUSEWHEEL =10,
EVENT_MOUSEHWHEEL =11
EVENT_MBUTTONDBLCLK = 9,
EVENT_MOUSEWHEEL = 10,
EVENT_MOUSEHWHEEL = 11
};
enum { EVENT_FLAG_LBUTTON = 1,
......
......@@ -40,7 +40,7 @@
//M*/
#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
......@@ -1395,13 +1395,9 @@ MainWindowProc( HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam )
flags |= (delta << 16);
POINT pt;
{
// since The coordinates are relative to screen so get screen size.
RECT windowRect;
::GetWindowRect( window->hwnd, &windowRect );
pt.x = GET_X_LPARAM( lParam ) - windowRect.left;
pt.y = GET_Y_LPARAM( lParam ) - windowRect.top;
}
pt.x = GET_X_LPARAM( lParam );
pt.y = GET_Y_LPARAM( lParam );
::ScreenToClient(hwnd, &pt); // Convert screen coordinates to client coordinates.
RECT 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