From ae9ea6b51f1cfec29d050618955237e3892f7d71 Mon Sep 17 00:00:00 2001 From: Manolo Gouy Date: Wed, 14 Jan 2015 14:21:01 +0000 Subject: When CGBitmapContextCreate() is used with null 5th argument, it is necessary to use CGBitmapContextGetBytesPerRow(). git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@10518 ea41ed52-d2ee-0310-a9c1-e6b18d33e121 --- src/Fl_cocoa.mm | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/Fl_cocoa.mm b/src/Fl_cocoa.mm index 969edd5f5..69ffaf1d1 100644 --- a/src/Fl_cocoa.mm +++ b/src/Fl_cocoa.mm @@ -4303,7 +4303,8 @@ void Fl_Paged_Device::print_window(Fl_Window *win, int x_offset, int y_offset) CGContextRef gc = CGBitmapContextCreate(NULL, win->w(), bt, 8, 0, cspace, kCGImageAlphaPremultipliedLast); CGColorSpaceRelease(cspace); [layer renderInContext:gc]; // 10.5 // draw all title bar to bitmap - Fl_RGB_Image *image = new Fl_RGB_Image((const uchar*)CGBitmapContextGetData(gc), win->w(), bt, 4); // 10.2 + Fl_RGB_Image *image = new Fl_RGB_Image((const uchar*)CGBitmapContextGetData(gc), win->w(), bt, 4, + CGBitmapContextGetBytesPerRow(gc)); // 10.2 image->draw(x_offset, y_offset); // draw title bar to PostScript delete image; CGContextRelease(gc); -- cgit v1.2.3