summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorManolo Gouy <Manolo>2018-08-28 12:33:27 +0000
committerManolo Gouy <Manolo>2018-08-28 12:33:27 +0000
commitd0739e8712834a81fe4eba41cc23f97652560968 (patch)
treeb45b14c9a11e787b1742d6e0c6103a407566e78d
parent9289a63af2a200b4b8ecd202694f415cba27e499 (diff)
Slightly simpler implementation of Fl_Cocoa_Gl_Window_Driver::alpha_mask_for_string() - continued.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.4@13032 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
-rw-r--r--src/gl_draw.cxx6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/gl_draw.cxx b/src/gl_draw.cxx
index f62cdea8a..6af0deb8e 100644
--- a/src/gl_draw.cxx
+++ b/src/gl_draw.cxx
@@ -760,11 +760,11 @@ char *Fl_Cocoa_Gl_Window_Driver::alpha_mask_for_string(const char *str, int n, i
{
// write str to a bitmap just big enough
Fl_Image_Surface *surf = new Fl_Image_Surface(w, h);
+ Fl_Font f=fl_font(); Fl_Fontsize s=fl_size();
Fl_Surface_Device::push_current(surf);
fl_color(FL_WHITE);
- CGContextScaleCTM(surf->offscreen(), gl_scale, gl_scale);
- CGContextTranslateCTM(surf->offscreen(), 0, fl_height() - fl_descent());
- fl_draw(str, n, 0, 0);
+ fl_font(f, s * gl_scale);
+ fl_draw(str, n, 0, fl_height() - fl_descent());
// get the alpha channel only of the bitmap
char *txt_buf = new char[w*h], *r = txt_buf, *q;
q = (char*)CGBitmapContextGetData(surf->offscreen());