Skip to content

Commit

Permalink
Mac OS: improved window printing when window title is longer than the…
Browse files Browse the repository at this point in the history
… window width.

git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@10073 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
  • Loading branch information
Manolo Gouy authored and Manolo Gouy committed Jan 21, 2014
1 parent 9ba8793 commit c4576ba
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/Fl_cocoa.mm
Expand Up @@ -3457,7 +3457,12 @@ Window fl_xid(const Fl_Window* w)
if (title) { // print the window title
fl_font(FL_HELVETICA, 14); // the exact font is LucidaGrande 13 pts
fl_color(FL_BLACK);
fl_draw(title, x_offset+win->w()/2-fl_width(title)/2, y_offset+bt/2+4);
const int skip = 68; // about the width of the zone of the 3 window control buttons
int x = x_offset + win->w()/2 - fl_width(title)/2;
if (x < x_offset+skip) x = x_offset+skip;
fl_push_clip(x_offset, y_offset, win->w(), bt);
fl_draw(title, x, y_offset+bt/2+4);
fl_pop_clip();
}
this->print_widget(win, x_offset, y_offset + bt); // print the window inner part
}
Expand Down

0 comments on commit c4576ba

Please sign in to comment.