Skip to content

Commit fdac738

Browse files
committed
(#126) Floating point cast to fix mouse drift
1 parent 5031a36 commit fdac738

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/win32/mouse.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,8 @@ static int32_t DEFAULT_DOUBLE_CLICK_INTERVAL_MS = 200;
3535
MMPoint CalculateAbsoluteCoordinates(MMPoint point) {
3636
MMSize displaySize = getMainDisplaySize();
3737
return MMPointMake(
38-
ceil(point.x * ABSOLUTE_COORD_CONST / displaySize.width),
39-
ceil(point.y * ABSOLUTE_COORD_CONST / displaySize.height)
38+
ceil((float)(point.x * ABSOLUTE_COORD_CONST) / displaySize.width),
39+
ceil((float)(point.y * ABSOLUTE_COORD_CONST) / displaySize.height)
4040
);
4141
}
4242

0 commit comments

Comments
 (0)