Compare commits

..

2 Commits

Author SHA1 Message Date
XueHaonan
90d8e2abd3
Merge 563c99cdca into 471f7ba05f 2024-10-10 12:09:45 +00:00
Xue Haonan
563c99cdca Fixed: fix macro definition.
Inside `mouse/mouse_c.h`: line 101
The expansion of MOUSE_COORD_TO_ABS will result in undesired calculation.
2024-10-10 20:06:20 +08:00

View File

@ -99,7 +99,7 @@ void moveMouse(MMPointInt32 point){
// Mouse motion is now done using SendInput with MOUSEINPUT. // Mouse motion is now done using SendInput with MOUSEINPUT.
// We use Absolute mouse positioning // We use Absolute mouse positioning
#define MOUSE_COORD_TO_ABS(coord, width_or_height) ( \ #define MOUSE_COORD_TO_ABS(coord, width_or_height) ( \
((65536 * coord) / width_or_height) + (coord < 0 ? -1 : 1)) ((65536 * (coord)) / (width_or_height)) + ((coord) < 0 ? (-1) : 1))
MMRectInt32 rect = getScreenRect(1); MMRectInt32 rect = getScreenRect(1);
int32_t x = MOUSE_COORD_TO_ABS(point.x - rect.origin.x, rect.size.w); int32_t x = MOUSE_COORD_TO_ABS(point.x - rect.origin.x, rect.size.w);