diff options
author | Michael Drake <tlsa@netsurf-browser.org> | 2014-08-20 11:08:35 +0100 |
---|---|---|
committer | Michael Drake <tlsa@netsurf-browser.org> | 2014-08-20 11:08:35 +0100 |
commit | 2cf3525b006d3eaf45adb3648d29d4590fc9927d (patch) | |
tree | 4e6e6a043ae4f5686c4f59ef4a30f36ea37af27e | |
parent | e5d2cba11f02c95712bf7aea3eb2f0eafa541046 (diff) | |
download | netsurf-2cf3525b006d3eaf45adb3648d29d4590fc9927d.tar.gz netsurf-2cf3525b006d3eaf45adb3648d29d4590fc9927d.tar.bz2 |
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.
-rw-r--r-- | render/layout.c | 1 |
1 files changed, 1 insertions, 0 deletions
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; } } |