diff options
| -rw-r--r-- | cairo/Fl_Cairo.cxx | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/cairo/Fl_Cairo.cxx b/cairo/Fl_Cairo.cxx index f94e1edf3..b6807a2ea 100644 --- a/cairo/Fl_Cairo.cxx +++ b/cairo/Fl_Cairo.cxx @@ -103,7 +103,14 @@ static cairo_surface_t * cairo_create_surface(void * gc, int W, int H) { # elif defined(_WIN32) return cairo_win32_surface_create((HDC) gc); # elif defined(__APPLE_QUARTZ__) - return cairo_quartz_surface_create_for_cg_context((CGContext*) gc, W, H); + CGAffineTransform mat = CGContextGetCTM((CGContextRef)gc); + if (mat.d > 0) { // necessary for layer-backed Cairo windows + CGContextRestoreGState((CGContextRef)gc); + CGContextRestoreGState((CGContextRef)gc); + CGContextSaveGState((CGContextRef)gc); + CGContextSaveGState((CGContextRef)gc); + } + return cairo_quartz_surface_create_for_cg_context((CGContextRef) gc, W, H); # else # error Cairo is not supported under this platform. # endif |
