From 9134956efe86b99abed3740fdd8c2caf7874dbf8 Mon Sep 17 00:00:00 2001 From: Michael Drake Date: Tue, 20 Jan 2009 21:36:54 +0000 Subject: Fix positioning of floats that come after floats with negative margins. svn path=/trunk/netsurf/; revision=6156 --- render/layout.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'render/layout.c') diff --git a/render/layout.c b/render/layout.c index bf5e1b664..1c8220385 100644 --- a/render/layout.c +++ b/render/layout.c @@ -1836,12 +1836,16 @@ bool layout_line(struct box *first, int *width, int *y, * Float affects current line */ if (b->type == BOX_FLOAT_LEFT) { b->x = cx + x0; - x0 += b->width; - left = b; + if (b->width > 0) { + x0 += b->width; + left = b; + } } else { b->x = cx + x1 - b->width; - x1 -= b->width; - right = b; + if (b->width > 0) { + x1 -= b->width; + right = b; + } } b->y = cy; } else { -- cgit v1.2.3