From d6053c3cb00772dc1c1f5422f0cdb7cdff03beb4 Mon Sep 17 00:00:00 2001 From: James Bursa Date: Fri, 18 Jul 2003 21:02:01 +0000 Subject: [project @ 2003-07-18 21:02:01 by bursa] Fix table positioning. svn path=/import/netsurf/; revision=234 --- render/layout.c | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/render/layout.c b/render/layout.c index 689490fc6..6ebc589f2 100644 --- a/render/layout.c +++ b/render/layout.c @@ -574,6 +574,7 @@ void layout_table(struct box * table, unsigned long width, struct box * cont, unsigned int *row_span, *excess_y, min; unsigned long x0; unsigned long x1; + unsigned long cy1; struct box *left; struct box *right; struct box *c; @@ -750,10 +751,11 @@ void layout_table(struct box * table, unsigned long width, struct box * cont, table->height = table_height; /* find sides and move table down if it doesn't fit in available width */ + cy1 = cy; while (1) { x0 = 0; x1 = width; - find_sides(cont->float_children, cy, cy + table_height, + find_sides(cont->float_children, cy1, cy1 + table_height, &x0, &x1, &left, &right); if (table_width <= x1 - x0) break; @@ -761,16 +763,16 @@ void layout_table(struct box * table, unsigned long width, struct box * cont, break; /* move down to the next place where the space may increase */ if (left == 0) - cy = right->y + right->height + 1; + cy1 = right->y + right->height + 1; else if (right == 0) - cy = left->y + left->height + 1; + cy1 = left->y + left->height + 1; else if (left->y + left->height < right->y + right->height) - cy = left->y + left->height + 1; + cy1 = left->y + left->height + 1; else - cy = right->y + right->height + 1; + cy1 = right->y + right->height + 1; } table->x = x0; - table->y = cy; + table->y += cy1 - cy; } -- cgit v1.2.3