From e4952d83ebc71d0e93b7e64c5c87fbd480288c40 Mon Sep 17 00:00:00 2001 From: John Mark Bell Date: Thu, 15 Apr 2004 16:18:19 +0000 Subject: [project @ 2004-04-15 16:18:19 by jmb] Take account of configured minimun font size when calculating line height. svn path=/import/netsurf/; revision=786 --- render/layout.c | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) (limited to 'render/layout.c') diff --git a/render/layout.c b/render/layout.c index e58534c99..103edb061 100644 --- a/render/layout.c +++ b/render/layout.c @@ -24,6 +24,7 @@ #ifdef riscos #include "netsurf/desktop/gui.h" #endif +#include "netsurf/desktop/options.h" #include "netsurf/render/box.h" #include "netsurf/render/font.h" #include "netsurf/render/layout.h" @@ -550,23 +551,28 @@ void layout_inline_container(struct box *box, int width, int line_height(struct css_style *style) { + float font_len; + assert(style); assert(style->line_height.size == CSS_LINE_HEIGHT_LENGTH || style->line_height.size == CSS_LINE_HEIGHT_ABSOLUTE || style->line_height.size == CSS_LINE_HEIGHT_PERCENT); + /* take account of minimum font size option */ + if ((font_len = len(&style->font_size.value.length, 0)) < + ((float)(option_font_min_size * 9.0 / 72.0))) + font_len = (float)(option_font_min_size * 9.0 / 72.0); + switch (style->line_height.size) { case CSS_LINE_HEIGHT_LENGTH: return len(&style->line_height.value.length, style); case CSS_LINE_HEIGHT_ABSOLUTE: - return style->line_height.value.absolute * - len(&style->font_size.value.length, 0); + return style->line_height.value.absolute * font_len; case CSS_LINE_HEIGHT_PERCENT: default: - return style->line_height.value.percent * - len(&style->font_size.value.length, 0) + return style->line_height.value.percent * font_len / 100.0; } } -- cgit v1.2.3