Skip to content

Commit e4a8b4f

Browse files
Squash x and y coord methods
Make Absolute coord calculation return MMPoint
1 parent b3e18e4 commit e4a8b4f

File tree

1 file changed

+2
-7
lines changed

1 file changed

+2
-7
lines changed

src/win32/mouse.c

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -29,14 +29,9 @@
2929
: ((button) == RIGHT_BUTTON ? MOUSEEVENTF_RIGHTDOWN \
3030
: MOUSEEVENTF_MIDDLEDOWN))
3131

32-
int CalculateAbsoluteCoordinateX(int x) {
32+
int CalculateAbsoluteCoordinates(MMPoint point) {
3333
MMSize displaySize = getMainDisplaySize();
34-
return (x * 65536) / displaySize.width;
35-
}
36-
37-
int CalculateAbsoluteCoordinateY(int y) {
38-
MMSize displaySize = getMainDisplaySize();
39-
return (y * 65536) / displaySize.height;
34+
return MMPointMake((x / displaySize.width) * ABSOLUTE_COORD_CONST, (y / displaySize.height) * ABSOLUTE_COORD_CONST);
4035
}
4136

4237
/**

0 commit comments

Comments
 (0)