Skip to content

Commit b0258ad

Browse files
committed
Improve conversion accuracy.
1 parent b2745cc commit b0258ad

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/mouse.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,8 @@ void moveMouse(MMPoint point)
3636
0, 0, 0, 0, point.x, point.y);
3737
XFlush(display);
3838
#elif defined(IS_WINDOWS)
39-
point.x *= 0xFFFF / GetSystemMetrics(SM_CXSCREEN);
40-
point.y *= 0xFFFF / GetSystemMetrics(SM_CYSCREEN);
39+
point.x *= 65536.0f / GetSystemMetrics(SM_CXSCREEN);
40+
point.y *= 65536.0f / GetSystemMetrics(SM_CYSCREEN);
4141
mouse_event(MOUSEEVENTF_ABSOLUTE | MOUSEEVENTF_MOVE,
4242
(DWORD)point.x, (DWORD)point.y, 0, 0);
4343
#endif

0 commit comments

Comments
 (0)