diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/fl_font.cxx | 9 | ||||
| -rw-r--r-- | src/fl_font_win32.cxx | 4 |
2 files changed, 7 insertions, 6 deletions
diff --git a/src/fl_font.cxx b/src/fl_font.cxx index 6f9a1e0f6..b451ad170 100644 --- a/src/fl_font.cxx +++ b/src/fl_font.cxx @@ -69,10 +69,11 @@ void fl_draw(const char* str, int x, int y) { } void fl_text_extents(const char *c, int &dx, int &dy, int &w, int &h) { - if (c) return fl_text_extents(c, strlen(c), dx, dy, w, h); - // else - w = 0; h = 0; - dx = 0; dy = 0; + if (c) fl_text_extents(c, strlen(c), dx, dy, w, h); + else { + w = 0; h = 0; + dx = 0; dy = 0; + } } // fl_text_extents diff --git a/src/fl_font_win32.cxx b/src/fl_font_win32.cxx index bf1bddeee..e38ac3a90 100644 --- a/src/fl_font_win32.cxx +++ b/src/fl_font_win32.cxx @@ -239,7 +239,7 @@ void fl_text_extents(const char *c, int n, int &dx, int &dy, int &w, int &h) { GLYPHMETRICS metrics; int maxw = 0, maxh = 0, dh; int minx = 0, miny = -999999; - unsigned len = 0; + unsigned len = 0, idx = 0; // Have we loaded the GetGlyphIndicesW function yet? if (have_loaded_GetGlyphIndices == 0) { @@ -266,7 +266,7 @@ void fl_text_extents(const char *c, int n, int &dx, int &dy, int &w, int &h) { } // now we have the glyph array we measure each glyph in turn... - for(unsigned idx = 0; idx < len; idx++){ + for(idx = 0; idx < len; idx++){ if (GetGlyphOutlineW (fl_gc, gi[idx], GGO_METRICS | GGO_GLYPH_INDEX, &metrics, 0, NULL, &matrix) == GDI_ERROR) { goto exit_error; |
