Fix @@ drawing (STR #84)

git-svn-id: file:///fltk/svn/fltk/branches/branch-1.1@3029 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
This commit is contained in:
Michael R Sweet 2003-06-15 04:13:17 +00:00
parent 84b2499c38
commit 1bde669d75
2 changed files with 7 additions and 5 deletions

View File

@ -1,5 +1,7 @@
CHANGES IN FLTK 1.1.4 CHANGES IN FLTK 1.1.4
- fl_draw() didn't properly handle a trailing escaped
"@" character (STR #84)
- Added documentation for all forms of - Added documentation for all forms of
Fl_Widget::damage() (STR #61) Fl_Widget::damage() (STR #61)
- Fl_Double_Window now has a type() value of - Fl_Double_Window now has a type() value of

View File

@ -1,5 +1,5 @@
// //
// "$Id: fl_draw.cxx,v 1.6.2.4.2.13 2003/01/30 21:43:39 easysw Exp $" // "$Id: fl_draw.cxx,v 1.6.2.4.2.14 2003/06/15 04:13:17 easysw Exp $"
// //
// Label drawing code for the Fast Light Tool Kit (FLTK). // Label drawing code for the Fast Light Tool Kit (FLTK).
// //
@ -143,7 +143,7 @@ void fl_draw(
symwidth[0] = min(w,h); symwidth[0] = min(w,h);
} }
if (str && (p = strrchr(str, '@')) != NULL && p > (str + 1)) { if (str && (p = strrchr(str, '@')) != NULL && p > (str + 1) && p[-1] != '@') {
strlcpy(symbol[1], p, sizeof(symbol[1])); strlcpy(symbol[1], p, sizeof(symbol[1]));
symwidth[1] = min(w,h); symwidth[1] = min(w,h);
} }
@ -156,7 +156,7 @@ void fl_draw(
e = expand(p, buf, w - symtotal, buflen, width, align&FL_ALIGN_WRAP, e = expand(p, buf, w - symtotal, buflen, width, align&FL_ALIGN_WRAP,
draw_symbols); draw_symbols);
lines++; lines++;
if (!*e || (*e == '@' && draw_symbols)) break; if (!*e || (*e == '@' && e[1] != '@' && draw_symbols)) break;
p = e; p = e;
} }
} else lines = 0; } else lines = 0;
@ -211,7 +211,7 @@ void fl_draw(
if (underline_at) if (underline_at)
callthis("_",1,xpos+int(fl_width(buf,underline_at-buf)),ypos-desc); callthis("_",1,xpos+int(fl_width(buf,underline_at-buf)),ypos-desc);
if (!*e || *e == '@') break; if (!*e || (*e == '@' && e[1] != '@')) break;
p = e; p = e;
} }
} }
@ -325,5 +325,5 @@ void fl_measure(const char* str, int& w, int& h, int draw_symbols) {
} }
// //
// End of "$Id: fl_draw.cxx,v 1.6.2.4.2.13 2003/01/30 21:43:39 easysw Exp $". // End of "$Id: fl_draw.cxx,v 1.6.2.4.2.14 2003/06/15 04:13:17 easysw Exp $".
// //