From 8bf3346ce24cdc889b7b52858ee2724229cb6a7d Mon Sep 17 00:00:00 2001 From: Michael Drake Date: Wed, 2 Jan 2013 12:46:17 +0000 Subject: Fix min_max line width calc to include box spaces. --- render/layout.c | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/render/layout.c b/render/layout.c index 702cc03c6..331e1efdb 100644 --- a/render/layout.c +++ b/render/layout.c @@ -3045,11 +3045,15 @@ struct box *layout_minmax_line(struct box *first, &fixed, &frac); if (0 < fixed) max += fixed; - if (b->next && b->space == UNKNOWN_WIDTH) { - font_func->font_width(&fstyle, " ", 1, - &b->space); + + if (b->next) { + if (b->space == UNKNOWN_WIDTH) { + font_func->font_width(&fstyle, " ", 1, + &b->space); + } max += b->space; } + *line_has_height = true; continue; } @@ -3095,9 +3099,11 @@ struct box *layout_minmax_line(struct box *first, } } max += b->width; - if (b->next && b->space == UNKNOWN_WIDTH) { - font_func->font_width(&fstyle, " ", 1, - &b->space); + if (b->next) { + if (b->space == UNKNOWN_WIDTH) { + font_func->font_width(&fstyle, " ", 1, + &b->space); + } max += b->space; } -- cgit v1.2.3