Fix error with PostScript driver on the Mac platform.

git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3-porting@11481 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
This commit is contained in:
Manolo Gouy 2016-03-31 05:01:22 +00:00
parent 9959aff368
commit 62f9813e4e
2 changed files with 10 additions and 5 deletions

View File

@ -180,8 +180,10 @@ int Fl_Widget_Surface::printable_rect(int *w, int *h) {return 1;}
*/
void Fl_Widget_Surface::draw_decorated_window(Fl_Window *win, int x_offset, int y_offset)
{
Fl_Shared_Image *top, *left, *bottom, *right;
win->driver()->capture_titlebar_and_borders(top, left, bottom, right);
Fl_Shared_Image *top=0, *left=0, *bottom=0, *right=0;
if (win->border() && !win->parent()) {
win->driver()->capture_titlebar_and_borders(top, left, bottom, right);
}
int wsides = left ? left->w() : 0;
int toph = top ? top->h() : 0;
if (top) {

View File

@ -98,6 +98,7 @@ void Fl_Cocoa_Window_Driver::flush_overlay()
void Fl_Cocoa_Window_Driver::draw_begin()
{
if (!Fl_Surface_Device::surface()->driver()->has_feature(Fl_Graphics_Driver::NATIVE)) return;
CGContextRef gc = (CGContextRef)Fl_Surface_Device::surface()->driver()->gc();
if (shape_data_) {
# if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_4
@ -118,8 +119,7 @@ void Fl_Cocoa_Window_Driver::draw_end()
{
// on OS X, windows have no frame. Before OS X 10.7, to resize a window, we drag the lower right
// corner. This code draws a little ribbed triangle for dragging.
CGContextRef gc = (CGContextRef)Fl_Surface_Device::surface()->driver()->gc();
if (fl_mac_os_version < 100700 && gc && !parent() && pWindow->resizable() &&
if (fl_mac_os_version < 100700 && !parent() && pWindow->resizable() &&
(!size_range_set() || minh() != maxh() || minw() != maxw())) {
int dx = Fl::box_dw(pWindow->box())-Fl::box_dx(pWindow->box());
int dy = Fl::box_dh(pWindow->box())-Fl::box_dy(pWindow->box());
@ -139,7 +139,10 @@ void Fl_Cocoa_Window_Driver::draw_end()
}
}
# if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_4
if (shape_data_) CGContextRestoreGState(gc);
if (Fl_Surface_Device::surface()->driver()->has_feature(Fl_Graphics_Driver::NATIVE)) {
CGContextRef gc = (CGContextRef)Fl_Surface_Device::surface()->driver()->gc();
if (shape_data_) CGContextRestoreGState(gc);
}
# endif
}