Use ScreenToClient() instead of painstakingly (and incorrectly) transforming
the position in this function itself.
Closes #12024.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@64286
c3d73ce0-8a6f-49c7-b76d-
6d57e0e08775
event.SetTimestamp(::GetMessageTime());
#endif
- // translate the position to client coords
- POINT pt;
-#ifdef __WXWINCE__
- GetCursorPosWinCE(&pt);
-#else
- GetCursorPos(&pt);
-#endif
- RECT rect;
- GetWindowRect(GetHwnd(),&rect);
- pt.x -= rect.left;
- pt.y -= rect.top;
-
- event.m_x = pt.x;
- event.m_y = pt.y;
+ // translate the position to client coordinates
+ const wxPoint mousePos = ScreenToClient(wxGetMousePosition());
+ event.m_x = mousePos.x;
+ event.m_y = mousePos.y;
return event;
}