summaryrefslogtreecommitdiff
path: root/src/Fl_cocoa.mm
diff options
context:
space:
mode:
authorManolo Gouy <Manolo>2018-05-06 07:14:13 +0000
committerManolo Gouy <Manolo>2018-05-06 07:14:13 +0000
commit5c16dcb65bfd8831a6834589fcfe5d5854386098 (patch)
tree5b1abc66856de9dd36ce65c75467b842969d4289 /src/Fl_cocoa.mm
parentaab1b72af4924293ffc2fa74180480dc9afcc06f (diff)
Simplify Fl_XXX_Window_Driver::capture_titlebar_and_borders() using Fl_Image::scale().
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.4@12902 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
Diffstat (limited to 'src/Fl_cocoa.mm')
-rw-r--r--src/Fl_cocoa.mm7
1 files changed, 3 insertions, 4 deletions
diff --git a/src/Fl_cocoa.mm b/src/Fl_cocoa.mm
index 20c15e857..06c8af91c 100644
--- a/src/Fl_cocoa.mm
+++ b/src/Fl_cocoa.mm
@@ -4332,7 +4332,7 @@ void Fl_Cocoa_Window_Driver::draw_layer_to_context(CALayer *layer, CGContextRef
/* Returns images of the capture of the window title-bar.
On the Mac OS platform, left, bottom and right are returned NULL; top is returned with depth 4.
*/
-void Fl_Cocoa_Window_Driver::capture_titlebar_and_borders(Fl_Shared_Image*& top, Fl_Shared_Image*& left, Fl_Shared_Image*& bottom, Fl_Shared_Image*& right)
+void Fl_Cocoa_Window_Driver::capture_titlebar_and_borders(Fl_RGB_Image*& top, Fl_RGB_Image*& left, Fl_RGB_Image*& bottom, Fl_RGB_Image*& right)
{
left = bottom = right = NULL;
int htop = pWindow->decorated_h() - h();
@@ -4370,9 +4370,8 @@ void Fl_Cocoa_Window_Driver::capture_titlebar_and_borders(Fl_Shared_Image*& top,
CGContextRestoreGState(auxgc);
CFRelease(img);
}
- Fl_RGB_Image *top_rgb = new Fl_RGB_Image(rgba, 2 * scaled_w, 2 * htop, 4);
- top_rgb->alloc_array = 1;
- top = Fl_Shared_Image::get(top_rgb);
+ top = new Fl_RGB_Image(rgba, 2 * scaled_w, 2 * htop, 4);
+ top->alloc_array = 1;
top->scale(w(),htop, s <1 ? 0 : 1, 1);
CGContextRelease(auxgc);
}