summaryrefslogtreecommitdiff
path: root/debug
diff options
context:
space:
mode:
authorJames Bursa <james@netsurf-browser.org>2003-09-17 12:57:43 +0000
committerJames Bursa <james@netsurf-browser.org>2003-09-17 12:57:43 +0000
commit763f1867056f266e3bf702e58e4e373a931fac26 (patch)
tree66b6ae5af2101b243e34d370f070ab579183502d /debug
parentd0d3e96cbb77cddee69ad7f8740d562d27051fc5 (diff)
downloadnetsurf-763f1867056f266e3bf702e58e4e373a931fac26.tar.gz
netsurf-763f1867056f266e3bf702e58e4e373a931fac26.tar.bz2
[project @ 2003-09-17 12:57:33 by bursa]
Poll queuing fix, backup redraw code. svn path=/import/netsurf/; revision=296
Diffstat (limited to 'debug')
-rw-r--r--debug/fontd.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/debug/fontd.c b/debug/fontd.c
index f4537c238..2d6e3a51f 100644
--- a/debug/fontd.c
+++ b/debug/fontd.c
@@ -152,8 +152,16 @@ void font_close(struct font_data *data)
char * font_split(struct font_data *data, const char * text, unsigned int length,
unsigned int width, unsigned int *used_width)
{
- *used_width = width;
+ int i = width / 10;
- return text + (width / 10);
+ if (length < i) {
+ *used_width = length * 10;
+ return text + length;
+ }
+
+ for (; i != 0 && text[i] != ' '; i--)
+ ;
+ *used_width = i * 10;
+ return text + i;
}