From dffc8779ed8b1c1c2daa2f864897588df80e50b1 Mon Sep 17 00:00:00 2001 From: James Bursa Date: Thu, 23 Jul 2009 02:29:12 +0000 Subject: Set height of all text boxes in a line to the height of the highest one. This aligns the baseline of text which changes font size in a line. However, when the inline-block is reflowed, the heights do not shrink again where they could. svn path=/trunk/netsurf/; revision=8716 --- render/layout.c | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) (limited to 'render') diff --git a/render/layout.c b/render/layout.c index 5bf03a157..4d9adc468 100644 --- a/render/layout.c +++ b/render/layout.c @@ -1962,7 +1962,7 @@ bool layout_line(struct box *first, int *width, int *y, else if (b->text || b->type == BOX_INLINE_END) { space_after = 0; if (b->space) { - font_plot_style_from_css(b->style, + font_plot_style_from_css(b->style, &fstyle); /** \todo handle errors, optimize */ font_func->font_width(&fstyle, " ", 1, @@ -2269,6 +2269,15 @@ bool layout_line(struct box *first, int *width, int *y, assert(b != first || (move_y && 0 < used_height && (left || right))); + /* set height of all text boxes to line height */ + for (d = first; d != b; d = d->next) { + if (d->type == BOX_INLINE || d->type == BOX_BR || + d->type == BOX_TEXT || + d->type == BOX_INLINE_END) { + d->height = used_height; + } + } + /* handle clearance for br */ if (br_box && br_box->style->clear != CSS_CLEAR_NONE) { int clear_y = layout_clear(cont->float_children, @@ -3355,7 +3364,7 @@ void layout_lists(struct box *box, marker->height) / 2; } else if (marker->text) { if (marker->width == UNKNOWN_WIDTH) { - font_plot_style_from_css(marker->style, + font_plot_style_from_css(marker->style, &fstyle); font_func->font_width(&fstyle, marker->text, -- cgit v1.2.3