Author: manolo
Date: 2011-02-03 15:00:30 -0800 (Thu, 03 Feb 2011)
New Revision: 8365
Log:
Fix STR #2553: in function fl_width(unsigned), the SelectObject() statement was
put before making sure we have a valid gc, which was wrong.
Modified:
branches/branch-1.3/src/fl_font_win32.cxx
Modified: branches/branch-1.3/src/fl_font_win32.cxx
===================================================================
--- branches/branch-1.3/src/fl_font_win32.cxx 2011-02-03 11:11:31 UTC (rev
8364)
+++ branches/branch-1.3/src/fl_font_win32.cxx 2011-02-03 23:00:30 UTC (rev
8365)
@@ -188,7 +188,6 @@
unsigned int r;
r = (c & 0xFC00) >> 10;
if (!fl_fontsize->width[r]) {
- SelectObject(fl_gc, fl_fontsize->fid);
fl_fontsize->width[r] = (int*) malloc(sizeof(int) * 0x0400);
SIZE s;
unsigned short i = 0, ii = r * 0x400;
@@ -207,6 +206,7 @@
}
if (!gc)
Fl::fatal("Invalid graphic context: fl_width() failed because no valid
HDC was found!");
+ SelectObject(gc, fl_fontsize->fid);
for (; i < 0x400; i++) {
GetTextExtentPoint32W(gc, (WCHAR*)&ii, 1, &s);
fl_fontsize->width[r][i] = s.cx;
_______________________________________________
fltk-commit mailing list
[email protected]
http://lists.easysw.com/mailman/listinfo/fltk-commit