summaryrefslogtreecommitdiff
path: root/render
diff options
context:
space:
mode:
authorJames Bursa <james@netsurf-browser.org>2006-03-26 21:41:18 +0000
committerJames Bursa <james@netsurf-browser.org>2006-03-26 21:41:18 +0000
commit4750aa968f5b4f6002cd7cf5e47d5591287c2cab (patch)
tree7bf24337054e75fb0845c0c5557fbe060a3a0b64 /render
parent94a3993be61c075072ac87da2fd69cae2f6481ae (diff)
downloadnetsurf-4750aa968f5b4f6002cd7cf5e47d5591287c2cab.tar.gz
netsurf-4750aa968f5b4f6002cd7cf5e47d5591287c2cab.tar.bz2
[project @ 2006-03-26 21:41:18 by bursa]
Fix layout bug related to negative text indent (fixes 1437728). svn path=/import/netsurf/; revision=2185
Diffstat (limited to 'render')
-rw-r--r--render/layout.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/render/layout.c b/render/layout.c
index 0f97ff113..1d1c6afc7 100644
--- a/render/layout.c
+++ b/render/layout.c
@@ -1047,21 +1047,26 @@ bool layout_line(struct box *first, int width, int *y,
x0 -= cx;
x1 -= cx;
- /* get minimum line height from containing block */
- used_height = height = line_height(first->parent->parent->style);
+ if (indent)
+ x0 += layout_text_indent(first->parent->parent->style, width);
if (x1 < x0)
x1 = x0;
+ /* get minimum line height from containing block */
+ used_height = height = line_height(first->parent->parent->style);
+
/* pass 1: find height of line assuming sides at top of line: loop
* body executed at least once
* keep in sync with the loop in layout_minmax_line() */
+ LOG(("x0 %i, x1 %i, x1 - x0 %i", x0, x1, x1 - x0));
for (x = 0, b = first; x <= x1 - x0 && b != 0; b = b->next) {
assert(b->type == BOX_INLINE || b->type == BOX_INLINE_BLOCK ||
b->type == BOX_FLOAT_LEFT ||
b->type == BOX_FLOAT_RIGHT ||
b->type == BOX_BR || b->type == BOX_TEXT ||
b->type == BOX_INLINE_END);
+ LOG(("pass 1: b %p, x %i", b, x));
if (b->type == BOX_BR)
break;
@@ -1239,7 +1244,9 @@ bool layout_line(struct box *first, int width, int *y,
space_after = space_before = 0;
/* pass 2: place boxes in line: loop body executed at least once */
+ LOG(("x0 %i, x1 %i, x1 - x0 %i", x0, x1, x1 - x0));
for (x = x_previous = 0, b = first; x <= x1 - x0 && b; b = b->next) {
+ LOG(("pass 2: b %p, x %i", b, x));
if (b->type == BOX_INLINE || b->type == BOX_INLINE_BLOCK ||
b->type == BOX_TEXT ||
b->type == BOX_INLINE_END) {