aboutsummaryrefslogtreecommitdiffhomepage
path: root/tools/sk_app
diff options
context:
space:
mode:
Diffstat (limited to 'tools/sk_app')
-rw-r--r--tools/sk_app/win/Window_win.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/tools/sk_app/win/Window_win.cpp b/tools/sk_app/win/Window_win.cpp
index 10db0ec675..c442493b21 100644
--- a/tools/sk_app/win/Window_win.cpp
+++ b/tools/sk_app/win/Window_win.cpp
@@ -303,8 +303,8 @@ LRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
std::unique_ptr<TOUCHINPUT[]> inputs(new TOUCHINPUT[numInputs]);
if (GetTouchInputInfo((HTOUCHINPUT)lParam, numInputs, inputs.get(),
sizeof(TOUCHINPUT))) {
- RECT rect;
- GetClientRect(hWnd, &rect);
+ POINT topLeft = {0, 0};
+ ClientToScreen(hWnd, &topLeft);
for (uint16_t i = 0; i < numInputs; ++i) {
TOUCHINPUT ti = inputs[i];
Window::InputState state;
@@ -319,8 +319,8 @@ LRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
}
// TOUCHINPUT coordinates are in 100ths of pixels
// Adjust for that, and make them window relative
- LONG tx = (ti.x / 100) - rect.left;
- LONG ty = (ti.y / 100) - rect.top;
+ LONG tx = (ti.x / 100) - topLeft.x;
+ LONG ty = (ti.y / 100) - topLeft.y;
eventHandled = window->onTouch(ti.dwID, state, tx, ty) || eventHandled;
}
}