STR #1098: fl_measure now round fractional sizes up instead of down, so that an area that is create with the values returned from fl_measure will be large enough to hold the same text generated with fl_draw.

Or in short: OS X Tooltips will not wrap... .



git-svn-id: file:///fltk/svn/fltk/branches/branch-1.1@4663 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
This commit is contained in:
Matthias Melcher 2005-11-28 09:52:19 +00:00
parent 5c613e487e
commit 129c8e39ec
1 changed files with 2 additions and 1 deletions

View File

@ -38,6 +38,7 @@
#include "flstring.h"
#include <ctype.h>
#include <math.h>
#define MAXBUF 1024
@ -309,7 +310,7 @@ void fl_measure(const char* str, int& w, int& h, int draw_symbols) {
for (p = str, lines=0; p;) {
e = expand(p, buf, w - symtotal, buflen, width, w != 0, draw_symbols);
if (int(width) > W) W = int(width);
if (int(ceil(width)) > W) W = int(ceil(width));
lines++;
if (!*e || (*e == '@' && draw_symbols)) break;
p = e;