diff --git a/src/Fl_cocoa.mm b/src/Fl_cocoa.mm index 0108fe12d..c8fcb9053 100644 --- a/src/Fl_cocoa.mm +++ b/src/Fl_cocoa.mm @@ -3768,6 +3768,7 @@ int Fl_X::set_cursor(const Fl_RGB_Image *image, int hotx, int hoty) { // Alpha needs to be premultiplied for this format const uchar *i = (const uchar*)*image->data(); + const int extra_data = image->ld() ? (image->ld() - image->w() * image->d()) : 0; unsigned char *o = [bitmap bitmapData]; for (int y = 0;y < image->h();y++) { if (!(image->d() & 1)) { @@ -3791,7 +3792,7 @@ int Fl_X::set_cursor(const Fl_RGB_Image *image, int hotx, int hoty) { o += len; i += len; } - i += image->ld(); + i += extra_data; } NSImage *nsimage = [[NSImage alloc]