mirror of
https://github.com/go-vgo/robotgo.git
synced 2025-06-17 05:23:56 +00:00
Merge 563c99cdca
into e924f25fe1
This commit is contained in:
commit
024c4b6720
@ -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);
|
||||
|
@ -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,
|
||||
|
Loading…
Reference in New Issue
Block a user