diff options
| author | Matthias Melcher <fltk@matthiasm.com> | 2006-08-29 10:04:02 +0000 |
|---|---|---|
| committer | Matthias Melcher <fltk@matthiasm.com> | 2006-08-29 10:04:02 +0000 |
| commit | 00ec9da8f5cf0f37f3c64e0a45b4046f86153765 (patch) | |
| tree | 2048393d9d934ae53e79dbc1797106836d10ccef /src/fl_draw.cxx | |
| parent | ba8bb3d8c278a70895e3b138fcfe9cbd91d5cbd0 (diff) | |
- removed more inconsistencies between fl_draw and fl_measure (STR #1408)
- made the Tooltip hide code a little bit smarter
- Added subwindow test case to Fl_Tabs
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.1@5378 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
Diffstat (limited to 'src/fl_draw.cxx')
| -rw-r--r-- | src/fl_draw.cxx | 42 |
1 files changed, 21 insertions, 21 deletions
diff --git a/src/fl_draw.cxx b/src/fl_draw.cxx index d1fe15839..64aabb690 100644 --- a/src/fl_draw.cxx +++ b/src/fl_draw.cxx @@ -158,15 +158,13 @@ void fl_draw( symtotal = symwidth[0] + symwidth[1]; - if (str) { - for (p = str, lines=0; p;) { - e = expand(p, buf, w - symtotal, buflen, width, align&FL_ALIGN_WRAP, - draw_symbols); - lines++; - if (!*e || (*e == '@' && e[1] != '@' && draw_symbols)) break; - p = e; - } - } else lines = 0; + for (p = str, lines=0; p;) { + e = expand(p, buf, w - symtotal, buflen, width, align&FL_ALIGN_WRAP, + draw_symbols); + lines++; + if (!*e || (*e == '@' && e[1] != '@' && draw_symbols)) break; + p = e; + } if ((symwidth[0] || symwidth[1]) && lines) { if (symwidth[0]) symwidth[0] = lines * fl_height(); @@ -295,19 +293,21 @@ void fl_measure(const char* str, int& w, int& h, int draw_symbols) { symbol[1][0] = '\0'; symwidth[1] = 0; - if (str && str[0] == '@' && str[1] && str[1] != '@') { - // Start with a symbol... - for (symptr = symbol[0]; - *str && !isspace(*str) && symptr < (symbol[0] + sizeof(symbol[0]) - 1); - *symptr++ = *str++); - *symptr = '\0'; - if (isspace(*str)) str++; - symwidth[0] = h; - } + if (draw_symbols) { + if (str && str[0] == '@' && str[1] && str[1] != '@') { + // Start with a symbol... + for (symptr = symbol[0]; + *str && !isspace(*str) && symptr < (symbol[0] + sizeof(symbol[0]) - 1); + *symptr++ = *str++); + *symptr = '\0'; + if (isspace(*str)) str++; + symwidth[0] = min(w,h); + } - if (str && (p = strrchr(str, '@')) != NULL && p > (str + 1) && p[-1]!='@') { - strlcpy(symbol[1], p, sizeof(symbol[1])); - symwidth[1] = h; + if (str && (p = strrchr(str, '@')) != NULL && p > (str + 1) && p[-1]!='@') { + strlcpy(symbol[1], p, sizeof(symbol[1])); + symwidth[1] = min(w,h); + } } symtotal = symwidth[0] + symwidth[1]; |
