From 8491aecb353ea84c411a00baef400b8b09e84f7d Mon Sep 17 00:00:00 2001 From: Michael Drake Date: Sun, 3 Feb 2008 14:24:46 +0000 Subject: Ensure min line length takes into account margins, borders and paddings of objects. svn path=/trunk/netsurf/; revision=3827 --- render/layout.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'render') diff --git a/render/layout.c b/render/layout.c index a12029a47..ff5412434 100644 --- a/render/layout.c +++ b/render/layout.c @@ -46,8 +46,9 @@ #include "desktop/options.h" #include "render/box.h" #include "render/font.h" +#include "render/form.h" #include "render/layout.h" -#define NDEBUG +//#define NDEBUG #include "utils/log.h" #include "utils/talloc.h" #include "utils/utils.h" @@ -1601,7 +1602,7 @@ struct box *layout_minmax_line(struct box *first, continue; } - if (b->type == BOX_INLINE) { + if (b->type == BOX_INLINE && !b->object) { fixed = frac = 0; calculate_mbp_width(b->style, LEFT, &fixed, &frac); if (!b->inline_end) @@ -1699,6 +1700,10 @@ struct box *layout_minmax_line(struct box *first, else width = b->object->width; } + fixed = frac = 0; + calculate_mbp_width(b->style, LEFT, &fixed, &frac); + calculate_mbp_width(b->style, RIGHT, &fixed, &frac); + width += fixed; } else { /* form control with no object */ if (width == AUTO) -- cgit v1.2.3