summaryrefslogtreecommitdiff
path: root/render
diff options
context:
space:
mode:
authorJames Bursa <james@netsurf-browser.org>2009-07-23 02:29:12 +0000
committerJames Bursa <james@netsurf-browser.org>2009-07-23 02:29:12 +0000
commitdffc8779ed8b1c1c2daa2f864897588df80e50b1 (patch)
treece65faeaa5ef7368228c17633a6b5fab626e853d /render
parentf1eb054b87a7fa5b832ed1e5c8bc351a3478967a (diff)
downloadnetsurf-dffc8779ed8b1c1c2daa2f864897588df80e50b1.tar.gz
netsurf-dffc8779ed8b1c1c2daa2f864897588df80e50b1.tar.bz2
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
Diffstat (limited to 'render')
-rw-r--r--render/layout.c13
1 files changed, 11 insertions, 2 deletions
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,