diff options
author | John Mark Bell <jmb@netsurf-browser.org> | 2009-07-25 13:20:12 +0000 |
---|---|---|
committer | John Mark Bell <jmb@netsurf-browser.org> | 2009-07-25 13:20:12 +0000 |
commit | 2c00c55963d62e8732ad83b878c5d32588e89722 (patch) | |
tree | 26760310eba01d6c5981a7f847fd523334907b5f /render/layout.c | |
parent | 2939ec04dea352f959344547fa00b2a6d0d8355e (diff) | |
download | netsurf-2c00c55963d62e8732ad83b878c5d32588e89722.tar.gz netsurf-2c00c55963d62e8732ad83b878c5d32588e89722.tar.bz2 |
Simplify line-height calculation, deferring to nscss_len2px.
svn path=/trunk/netsurf/; revision=8783
Diffstat (limited to 'render/layout.c')
-rw-r--r-- | render/layout.c | 21 |
1 files changed, 3 insertions, 18 deletions
diff --git a/render/layout.c b/render/layout.c index b783171ce..ef7ac024d 100644 --- a/render/layout.c +++ b/render/layout.c @@ -1784,25 +1784,10 @@ int line_height(const css_computed_style *style) if (lhtype == CSS_LINE_HEIGHT_NUMBER || lhunit == CSS_UNIT_PCT) { - css_fixed fs = 0, px_fs; - css_unit fs_unit = CSS_UNIT_PX; + line_height = nscss_len2px(lhvalue, CSS_UNIT_EM, style); - css_computed_font_size(style, &fs, &fs_unit); - - /* Convert to points */ - fs = nscss_len2pt(fs, fs_unit); - fs_unit = CSS_UNIT_PT; - - /* Clamp to configured minimum */ - if (fs < FDIVI(INTTOFIX(option_font_min_size), 10)) - fs = FDIVI(INTTOFIX(option_font_min_size), 10); - - px_fs = nscss_len2px(fs, fs_unit, style); - - if (lhtype == CSS_LINE_HEIGHT_NUMBER) - line_height = FMUL(lhvalue, px_fs); - else - line_height = FDIVI(FMUL(lhvalue, px_fs), 100); + if (lhtype != CSS_LINE_HEIGHT_NUMBER) + line_height = FDIVI(line_height, 100); } else { assert(lhunit != CSS_UNIT_PCT); |