diff options
| author | ManoloFLTK <41016272+ManoloFLTK@users.noreply.github.com> | 2022-04-08 16:22:22 +0200 |
|---|---|---|
| committer | ManoloFLTK <41016272+ManoloFLTK@users.noreply.github.com> | 2022-04-08 16:22:22 +0200 |
| commit | 223bf6309b8591843246a966fe5ed23dbab34110 (patch) | |
| tree | 7e61ff879b66e402657e1cabc4be844011b9c453 /src | |
| parent | b4bbc53c5e7f17395b1d5330598565b60f71e543 (diff) | |
Fix for issue #426: "configure --enable-cairoext" flips display upside down
Diffstat (limited to 'src')
| -rw-r--r-- | src/Fl_cocoa.mm | 13 |
1 files changed, 4 insertions, 9 deletions
diff --git a/src/Fl_cocoa.mm b/src/Fl_cocoa.mm index 722472eed..e3cd499c1 100644 --- a/src/Fl_cocoa.mm +++ b/src/Fl_cocoa.mm @@ -3479,6 +3479,9 @@ void Fl_Cocoa_Window_Driver::make_current() gc = (CGContextRef)[nsgc performSelector:gc_sel]; } Fl_Graphics_Driver::default_driver().gc(gc); +#if defined(FLTK_HAVE_CAIROEXT) + CGContextSaveGState(gc); // one extra level +#endif CGContextSaveGState(gc); // native context // antialiasing must be deactivated because it applies to rectangles too // and escapes even clipping!!! @@ -3496,15 +3499,7 @@ void Fl_Cocoa_Window_Driver::make_current() } // this is the context with origin at top left of (sub)window CGContextSaveGState(gc); -#if defined(FLTK_HAVE_CAIROEXT) - if (Fl::cairo_autolink_context()) Fl::cairo_make_current(pWindow); // capture gc changes automatically to update the cairo context adequately -#endif fl_clip_region( 0 ); - -#if defined(FLTK_HAVE_CAIROEXT) - // update the cairo_t context - if (Fl::cairo_autolink_context()) Fl::cairo_make_current(pWindow); -#endif } // Give the Quartz context back to the system @@ -3517,7 +3512,7 @@ void Fl_Cocoa_Window_Driver::q_release_context(Fl_Cocoa_Window_Driver *x) { CGContextFlush(gc); Fl_Graphics_Driver::default_driver().gc(0); #if defined(FLTK_HAVE_CAIROEXT) - if (Fl::cairo_autolink_context()) Fl::cairo_make_current((Fl_Window*) 0); // capture gc changes automatically to update the cairo context adequately + CGContextRestoreGState(gc); #endif } |
