diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/fl_draw.cxx | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/src/fl_draw.cxx b/src/fl_draw.cxx index bf02f9d8e..d6e184002 100644 --- a/src/fl_draw.cxx +++ b/src/fl_draw.cxx @@ -3,7 +3,7 @@ // // Label drawing code for the Fast Light Tool Kit (FLTK). // -// Copyright 1998-2011 by Bill Spitzak and others. +// Copyright 1998-2016 by Bill Spitzak and others. // // This library is free software. Distribution and use rights are outlined in // the file "COPYING" which should have been included with this file. If this @@ -118,7 +118,7 @@ static const char* expand_text_(const char* from, char*& buf, int maxbuf, double Also word-wrap if width exceeds maxw. Returns a pointer to the start of the next line of characters. Sets n to the number of characters put into the buffer. - Sets width to the width of the string in the current font. + Sets width to the width of the string in the \ref drawing_fl_font "current font". */ const char* fl_expand_text(const char* from, char* buf, int maxbuf, double maxw, int& n, @@ -343,9 +343,13 @@ void fl_draw( fl_draw() function with \p align parameter. If the incoming \p w is non-zero it will wrap to that width. - The 'current font' is used to do the width/height calculations, - so unless its value is known at the time fl_measure() is called, - it is advised to first set the current font with fl_font(). + The \ref drawing_fl_font "current font" is used to do the width/height + calculations, so unless its value is known at the time fl_measure() is + called, it is advised to first set the current font with fl_font(). + With event-driven GUI programming you can never be sure which + widget was exposed and redrawn last, nor which font it used. + If you have not called fl_font() explicitly in your own code, + the width and height may be set to unexpected values, even zero! \b Note: In the general use case, it's a common error to forget to set \p w to 0 before calling fl_measure() when wrap behavior isn't needed. |
