From 1808739e3361c89f7d9a2995b5a1478c5fdf1b3e Mon Sep 17 00:00:00 2001 From: James Bursa Date: Sat, 6 Aug 2005 23:34:30 +0000 Subject: [PATCH] [project @ 2005-08-06 23:34:30 by bursa] Fix vertical positioning of floats when an empty block with top padding is present. svn path=/import/netsurf/; revision=1842 --- render/layout.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/render/layout.c b/render/layout.c index 3f8d87320..2e5cec984 100644 --- a/render/layout.c +++ b/render/layout.c @@ -220,6 +220,8 @@ bool layout_block_context(struct box *block, struct content *content) } } + LOG(("box %p, cx %i, cy %i", box, cx, cy)); + /* Layout (except tables). */ if (box->type == BOX_INLINE_CONTAINER) { box->width = box->parent->width; @@ -269,7 +271,8 @@ bool layout_block_context(struct box *block, struct content *content) } continue; - } + } else if (box->type == BOX_BLOCK) + cy += box->padding[TOP]; if (box->type == BOX_BLOCK && box->height == AUTO) box->height = 0; cy += box->height + box->padding[BOTTOM] + box->border[BOTTOM]; @@ -1687,6 +1690,7 @@ void place_float_below(struct box *c, int width, int cx, int y, int x0, x1, yy = y; struct box * left; struct box * right; + LOG(("c %p, width %i, cx %i, y %i, cont %p", c, width, cx, y, cont)); do { y = yy; x0 = cx;