This commit is contained in:
XueHaonan 2024-12-12 07:46:14 +13:00 committed by GitHub
commit 4db87b3d59
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 2 additions and 2 deletions

View File

@ -99,7 +99,7 @@ void moveMouse(MMPointInt32 point){
// Mouse motion is now done using SendInput with MOUSEINPUT.
// We use Absolute mouse positioning
#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);
int32_t x = MOUSE_COORD_TO_ABS(point.x - rect.origin.x, rect.size.w);

View File

@ -90,7 +90,7 @@ MMBitmapRef copyMMBitmapFromDisplayInRect(MMRectInt32 rect, int32_t display_id,
if (!imageData) { return NULL; }
bufferSize = CFDataGetLength(imageData);
buffer = malloc(bufferSize);
buffer = (uint8_t *)malloc(bufferSize);
CFDataGetBytes(imageData, CFRangeMake(0, bufferSize), buffer);
bitmap = createMMBitmap_c(buffer,