From 2cf3525b006d3eaf45adb3648d29d4590fc9927d Mon Sep 17 00:00:00 2001 From: Michael Drake Date: Wed, 20 Aug 2014 11:08:35 +0100 Subject: Fix text selection. Values returned by nscss_len2px are actually libcss fixed-points, so convert the result to pixels. Also reduce the amount by which the top of descendant bboxes are extended to 3/4 of the text height, which is the maximum possible amount that the text can protrude above the box when line-height is reduced. --- render/layout.c | 1 + 1 file changed, 1 insertion(+) (limited to 'render') diff --git a/render/layout.c b/render/layout.c index ffea31d17..ab2dd6cc1 100644 --- a/render/layout.c +++ b/render/layout.c @@ -5068,6 +5068,7 @@ static void layout_get_box_bbox(struct box *box, int *desc_x0, int *desc_y0, css_computed_font_size(box->style, &font_size, &font_unit); text_height = nscss_len2px(font_size, font_unit, box->style); + text_height = FIXTOINT(text_height * 3 / 4); *desc_y0 = (*desc_y0 < -text_height) ? *desc_y0 : -text_height; } } -- cgit v1.2.3