diff options
| author | Fabien Costantini <fabien@onepost.net> | 2008-12-11 14:38:04 +0000 |
|---|---|---|
| committer | Fabien Costantini <fabien@onepost.net> | 2008-12-11 14:38:04 +0000 |
| commit | 7b49e892b88414d692736a310dc615fc0f9b9acf (patch) | |
| tree | 6321aa1112231687b5e41de563ef9a5881ea21dd | |
| parent | 26c643740789d87ec14dce4f3892dbbf84ab558a (diff) | |
Fixing corelib would not compile under vc6 following fl_text_extents() addons. checked on win32/vc6,macosx. Please on other win32 compilers.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@6578 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
| -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; |
