From b1c1d85f97ed75738c8da7b626317e128e0f100d Mon Sep 17 00:00:00 2001 From: James Bursa Date: Thu, 23 Jul 2009 23:51:43 +0000 Subject: Better way of aligning text baselines. Move boxes down to align 0.75 point instead of changing height. svn path=/trunk/netsurf/; revision=8758 --- render/layout.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'render') diff --git a/render/layout.c b/render/layout.c index 411d6755e..a5cf231c4 100644 --- a/render/layout.c +++ b/render/layout.c @@ -2473,12 +2473,13 @@ 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 */ + /* align baselines of all text boxes by moving their y so that their + * 0.75 point is aligned */ 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; + d->y += 0.75 * used_height - 0.75 * d->height; } } -- cgit v1.2.3