mirror of
https://github.com/Ryujinx/SDL.git
synced 2024-12-26 01:15:41 +00:00
Fixed hit-testing on Windows.
Needed to convert from screen to client coords.
This commit is contained in:
parent
bf03bec120
commit
bcc2cc8722
|
@ -870,10 +870,13 @@ WIN_WindowProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
|
||||||
{
|
{
|
||||||
SDL_Window *window = data->window;
|
SDL_Window *window = data->window;
|
||||||
if (window->hit_test) {
|
if (window->hit_test) {
|
||||||
const SDL_Point point = { (int) LOWORD(lParam), (int) HIWORD(lParam) };
|
POINT winpoint = { (int) LOWORD(lParam), (int) HIWORD(lParam) };
|
||||||
const SDL_HitTestResult rc = window->hit_test(window, &point, window->hit_test_data);
|
if (ScreenToClient(data->hwnd, &winpoint)) {
|
||||||
if (rc == SDL_HITTEST_DRAGGABLE) {
|
const SDL_Point point = { (int) winpoint.x, (int) winpoint.y };
|
||||||
return HTCAPTION;
|
const SDL_HitTestResult rc = window->hit_test(window, &point, window->hit_test_data);
|
||||||
|
if (rc == SDL_HITTEST_DRAGGABLE) {
|
||||||
|
return HTCAPTION;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
// if we didn't return, this will call DefWindowProc below.
|
// if we didn't return, this will call DefWindowProc below.
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue