summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJames Bursa <james@netsurf-browser.org>2009-07-23 23:51:43 +0000
committerJames Bursa <james@netsurf-browser.org>2009-07-23 23:51:43 +0000
commitb1c1d85f97ed75738c8da7b626317e128e0f100d (patch)
treea6bb8fbafd8ca1ae1d57911d589c6ed6fb734da7
parent3dd350a5eac1f02281d26701e1319167af9b5a26 (diff)
downloadnetsurf-b1c1d85f97ed75738c8da7b626317e128e0f100d.tar.gz
netsurf-b1c1d85f97ed75738c8da7b626317e128e0f100d.tar.bz2
Better way of aligning text baselines. Move boxes down to align 0.75 point instead of changing height.
svn path=/trunk/netsurf/; revision=8758
-rw-r--r--render/layout.c5
1 files changed, 3 insertions, 2 deletions
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;
}
}