Skip to content

Commit

Permalink
STR #1098: fl_measure now round fractional sizes up instead of down, …
Browse files Browse the repository at this point in the history
…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
  • Loading branch information
Matthias Melcher committed Nov 28, 2005
1 parent 5c613e4 commit 129c8e3
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/fl_draw.cxx
Expand Up @@ -38,6 +38,7 @@

#include "flstring.h"
#include <ctype.h>
#include <math.h>

#define MAXBUF 1024

Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit 129c8e3

Please sign in to comment.