diff options
| author | Matthias Melcher <fltk@matthiasm.com> | 2007-02-12 16:41:41 +0000 |
|---|---|---|
| committer | Matthias Melcher <fltk@matthiasm.com> | 2007-02-12 16:41:41 +0000 |
| commit | 474fa58939d6c4b832686c023987bc6054fe0b58 (patch) | |
| tree | b0d3ac8dec560d0713809a886b5f3421c0124c34 /src | |
| parent | b5d637a4cdfa54a1c8843f03733f0b91fb9c4f12 (diff) | |
Fixed clipping in OS X Quartz offscreen buffers (STR #1595)
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.1@5692 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
Diffstat (limited to 'src')
| -rw-r--r-- | src/fl_rect.cxx | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/src/fl_rect.cxx b/src/fl_rect.cxx index f19f7067b..862ad73c9 100644 --- a/src/fl_rect.cxx +++ b/src/fl_rect.cxx @@ -483,7 +483,7 @@ void fl_restore_clip() { } # endif #elif defined(__APPLE_QUARTZ__) - if ( fl_window ) + if ( fl_window ) // clipping for a true window { GrafPtr port = GetWindowPort( fl_window ); if ( port ) { @@ -497,6 +497,16 @@ void fl_restore_clip() { Fl_X::q_fill_context(); DisposeRgn( portClip ); } + } else if (fl_gc) { // clipping for an offscreen drawing world (CGBitmap) + Rect portRect; + portRect.top = 0; + portRect.left = 0; + portRect.bottom = CGBitmapContextGetHeight(fl_gc); + portRect.right = CGBitmapContextGetWidth(fl_gc); + Fl_X::q_clear_clipping(); + if (r) + ClipCGContextToRegion(fl_gc, &portRect, r); + Fl_X::q_fill_context(); } #else if (r) XSetRegion(fl_display, fl_gc, r); |
