diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/Fl_cocoa.mm | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/Fl_cocoa.mm b/src/Fl_cocoa.mm index 8b392cdba..3a66b5933 100644 --- a/src/Fl_cocoa.mm +++ b/src/Fl_cocoa.mm @@ -3576,12 +3576,12 @@ static Fl_RGB_Image* get_image_from_clipboard(Fl_Widget *receiver) if (!bitmap) return NULL; int bytesPerPixel([bitmap bitsPerPixel]/8); int bpr([bitmap bytesPerRow]); - int bpp([bitmap bytesPerPlane]); - int hh(bpp/bpr); - int ww(bpr/bytesPerPixel); + int hh([bitmap pixelsHigh]); + int ww([bitmap pixelsWide]); uchar *imagedata = new uchar[bpr * hh]; memcpy(imagedata, [bitmap bitmapData], bpr * hh); - Fl_RGB_Image *image = new Fl_RGB_Image(imagedata, ww, hh, bytesPerPixel); + Fl_RGB_Image *image = new Fl_RGB_Image(imagedata, ww, hh, bytesPerPixel, (bpr == ww * bytesPerPixel ? 0 : bpr) ); + image->scale([bitmap size].width, [bitmap size].height); image->alloc_array = 1; [bitmap release]; Fl::e_clipboard_type = Fl::clipboard_image; |
