From 129c8e39ecceea036ec1ae24f9464e5074d3289f Mon Sep 17 00:00:00 2001 From: Matthias Melcher Date: Mon, 28 Nov 2005 09:52:19 +0000 Subject: 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 --- src/fl_draw.cxx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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 +#include #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; -- cgit v1.2.3