summaryrefslogtreecommitdiff
path: root/src/fl_draw.cxx
diff options
context:
space:
mode:
authorMatthias Melcher <fltk@matthiasm.com>2005-11-28 09:52:19 +0000
committerMatthias Melcher <fltk@matthiasm.com>2005-11-28 09:52:19 +0000
commit129c8e39ecceea036ec1ae24f9464e5074d3289f (patch)
tree72f3eb768b0ce76a27e14eafe0b9443e7a4a8584 /src/fl_draw.cxx
parent5c613e487e180b085176dd507fc9005af74b592f (diff)
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
Diffstat (limited to 'src/fl_draw.cxx')
-rw-r--r--src/fl_draw.cxx3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/fl_draw.cxx b/src/fl_draw.cxx
index bcf8962d2..2daaab077 100644
--- a/src/fl_draw.cxx
+++ b/src/fl_draw.cxx
@@ -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;