diff options
author | James Bursa <james@netsurf-browser.org> | 2003-07-15 23:11:03 +0000 |
---|---|---|
committer | James Bursa <james@netsurf-browser.org> | 2003-07-15 23:11:03 +0000 |
commit | ebcf1cb3455cedb9ea1aafd464b42c68e4596a73 (patch) | |
tree | ba4eef9eeb9345f5cfd397f3b472f0ccfcd52ab8 | |
parent | 18bf9706dd8b9d6362f1361d34d968c7e0c9dfa7 (diff) | |
download | netsurf-ebcf1cb3455cedb9ea1aafd464b42c68e4596a73.tar.gz netsurf-ebcf1cb3455cedb9ea1aafd464b42c68e4596a73.tar.bz2 |
[project @ 2003-07-15 23:11:03 by bursa]
Fix first letter cut off bug.
svn path=/import/netsurf/; revision=223
-rw-r--r-- | render/layout.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/render/layout.c b/render/layout.c index 1fb27b77c..7949d1d3a 100644 --- a/render/layout.c +++ b/render/layout.c @@ -459,7 +459,7 @@ struct box * layout_line(struct box * first, unsigned long width, unsigned long else w = font_width(c->font, c->text, (unsigned int) (space - c->text)); - if (x1 - x0 < x + space_before + w && left == 0 && right == 0 && c == first) { + if (x1 - x0 <= x + space_before + w && left == 0 && right == 0 && c == first) { /* first word doesn't fit, but no floats and first on line so force in */ if (space == 0) { /* only one word in this box or not text */ @@ -479,7 +479,7 @@ struct box * layout_line(struct box * first, unsigned long width, unsigned long } x += space_before + w; /* fprintf(stderr, "layout_line: overflow, forcing\n"); */ - } else if (x1 - x0 < x + space_before + w) { + } else if (x1 - x0 <= x + space_before + w) { /* first word doesn't fit, but full width not available so leave for later */ b = c; /* fprintf(stderr, "layout_line: overflow, leaving\n"); */ @@ -490,6 +490,7 @@ struct box * layout_line(struct box * first, unsigned long width, unsigned long x1 - x0 - x - space_before, &w); LOG(("'%.*s' %lu %u (%c) %u", (int) c->length, c->text, (unsigned long) (x1 - x0), space - c->text, *space, w)); + assert(space != c->text); c2 = memcpy(xcalloc(1, sizeof(struct box)), c, sizeof(struct box)); c2->text = xstrdup(space + 1); c2->length = c->length - ((space + 1) - c->text); |