From 80d6099c45e7741df8c77a0668eedfd0133cbffa Mon Sep 17 00:00:00 2001 From: Manolo Gouy Date: Wed, 6 Apr 2011 12:33:34 +0000 Subject: Window title bars are now printed with their rounded angles. git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@8564 ea41ed52-d2ee-0310-a9c1-e6b18d33e121 --- src/Fl_cocoa.mm | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/Fl_cocoa.mm b/src/Fl_cocoa.mm index 27b23260c..07ecf5260 100644 --- a/src/Fl_cocoa.mm +++ b/src/Fl_cocoa.mm @@ -2842,7 +2842,21 @@ int Fl_X::screen_init(XRectangle screens[], float dpi[]) printer.rotate(20.); printer.print_widget( win, - win->w()/2, - win->h()/2 ); #else - if (bt) printer.print_window_part(win, 0, -bt, win->w(), bt, 0, 1); + if (bt) { // print the window title bar + //printer.print_window_part(win, 0, -bt, win->w(), bt, 0, 1); + Fl_Display_Device::display_device()->set_current(); + win->show(); + fl_gc = NULL; + Fl::check(); + win->make_current(); + CGImageRef img = Fl_X::CGImage_from_window_rect(win, 0, -bt, win->w(), bt); + printer.set_current(); + CGRect rect = { { 0, 1 }, { win->w(), bt } }; + Fl_X::q_begin_image(rect, 0, 0, win->w(), bt); + CGContextDrawImage(fl_gc, rect, img); + Fl_X::q_end_image(); + CGImageRelease(img); + } printer.print_widget(win, 0, bt); #endif printer.end_page(); -- cgit v1.2.3