Fixed bug in Mac OS version of gl_draw() that could produce truncated strings.

git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@10847 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
This commit is contained in:
Manolo Gouy 2015-08-29 07:04:08 +00:00
parent 5ea322679c
commit 529927e0b8

View File

@ -446,6 +446,7 @@ int gl_texture_fifo::compute_texture(const char* str, int n)
memcpy(fifo[current].utf8, str, n);
fifo[current].utf8[n] = 0;
fifo[current].width = 0, fifo[current].height = 0;
fl_graphics_driver->font_descriptor(gl_fontsize);
fl_measure(fifo[current].utf8, fifo[current].width, fifo[current].height, 0);
fifo[current].width *= gl_scale;
fifo[current].height *= gl_scale;
@ -456,7 +457,6 @@ int gl_texture_fifo::compute_texture(const char* str, int n)
CGContextRef save_gc = fl_gc;
fl_gc = CGBitmapContextCreate(base, fifo[current].width, fifo[current].height, 8, fifo[current].width*4, lut, kCGImageAlphaPremultipliedLast);
CGColorSpaceRelease(lut);
fl_graphics_driver->font_descriptor(gl_fontsize);
GLfloat colors[4];
glGetFloatv(GL_CURRENT_COLOR, colors);
fl_color((uchar)(colors[0]*255), (uchar)(colors[1]*255), (uchar)(colors[2]*255));