From a2f22358cd11047fda8bb6f8af382776e099cd5e Mon Sep 17 00:00:00 2001 From: Manolo Gouy Date: Sun, 19 Feb 2017 15:49:48 +0000 Subject: Fix line wrap at word end when string widths are true double values (non integer). Useful for rescaling that creates non-integer string widths. git-svn-id: file:///fltk/svn/fltk/branches/branch-1.4@12176 ea41ed52-d2ee-0310-a9c1-e6b18d33e121 --- src/fl_draw.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/fl_draw.cxx b/src/fl_draw.cxx index d6e184002..137dfaf8d 100644 --- a/src/fl_draw.cxx +++ b/src/fl_draw.cxx @@ -64,7 +64,7 @@ static const char* expand_text_(const char* from, char*& buf, int maxbuf, double // test for word-wrap: if (word_start < p && wrap) { double newwidth = w + fl_width(word_end, (int) (o-word_end) ); - if (word_end > buf && newwidth > maxw) { // break before this word + if (word_end > buf && int(newwidth) > maxw) { // break before this word o = word_end; p = word_start; break; -- cgit v1.2.3