Scale mouse coordinates based on window size
- Fixed: If you enlarged the game window (in windowed mode) so that the window is bigger than the selected resolution, the menu would still take its inputs from the portion in the upper left that matched the resolution.
This commit is contained in:
parent
d166211ce0
commit
9b6756114b
5 changed files with 43 additions and 9 deletions
|
|
@ -323,11 +323,11 @@ bool GUIWndProcHook(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam, LRESU
|
|||
if (BlockMouseMove > 0) return true;
|
||||
}
|
||||
|
||||
ev.data1 = LOWORD(lParam);
|
||||
ev.data2 = HIWORD(lParam);
|
||||
if (screen != NULL)
|
||||
{
|
||||
int shift = screen? screen->GetPixelDoubling() : 0;
|
||||
ev.data1 = LOWORD(lParam) >> shift;
|
||||
ev.data2 = HIWORD(lParam) >> shift;
|
||||
if (screen) ev.data2 -= (screen->GetTrueHeight() - screen->GetHeight())/2;
|
||||
screen->ScaleCoordsFromWindow(ev.data1, ev.data2);
|
||||
}
|
||||
|
||||
if (wParam & MK_SHIFT) ev.data3 |= GKM_SHIFT;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue