Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed macro definition bug in mouse_c.h #697

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion mouse/mouse_c.h
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion screen/screengrab_c.h
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down