summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorManolo Gouy <Manolo>2011-02-03 23:00:30 +0000
committerManolo Gouy <Manolo>2011-02-03 23:00:30 +0000
commit2251609ab3a4db3ed65c6e2974f6f92e0c564a5e (patch)
treef14c984b54c55e8866f5b62e72404c23e1df6e1b
parentfe367d13098a3d8730782d4f15fa6a727e4ae25d (diff)
Fix STR #2553: in function fl_width(unsigned), the SelectObject() statement was
put before making sure we have a valid gc, which was wrong. git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@8365 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
-rw-r--r--src/fl_font_win32.cxx2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/fl_font_win32.cxx b/src/fl_font_win32.cxx
index bfbd1f349..5c5238605 100644
--- a/src/fl_font_win32.cxx
+++ b/src/fl_font_win32.cxx
@@ -188,7 +188,6 @@ double fl_width(unsigned int c) {
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 @@ double fl_width(unsigned int c) {
}
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;