From e4a8b4fd6da93dbf05ab52bfdd5f5bcd43c3c28c Mon Sep 17 00:00:00 2001 From: Reiss Cashmore Date: Sun, 10 Oct 2021 22:32:18 +0100 Subject: [PATCH] Squash x and y coord methods Make Absolute coord calculation return MMPoint --- src/win32/mouse.c | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/src/win32/mouse.c b/src/win32/mouse.c index 88c05cd..95e1158 100644 --- a/src/win32/mouse.c +++ b/src/win32/mouse.c @@ -29,14 +29,9 @@ : ((button) == RIGHT_BUTTON ? MOUSEEVENTF_RIGHTDOWN \ : MOUSEEVENTF_MIDDLEDOWN)) -int CalculateAbsoluteCoordinateX(int x) { +int CalculateAbsoluteCoordinates(MMPoint point) { MMSize displaySize = getMainDisplaySize(); - return (x * 65536) / displaySize.width; -} - -int CalculateAbsoluteCoordinateY(int y) { - MMSize displaySize = getMainDisplaySize(); - return (y * 65536) / displaySize.height; + return MMPointMake((x / displaySize.width) * ABSOLUTE_COORD_CONST, (y / displaySize.height) * ABSOLUTE_COORD_CONST); } /**