summaryrefslogtreecommitdiff
path: root/render
diff options
context:
space:
mode:
authorJohn Mark Bell <jmb@netsurf-browser.org>2004-04-15 16:18:19 +0000
committerJohn Mark Bell <jmb@netsurf-browser.org>2004-04-15 16:18:19 +0000
commite4952d83ebc71d0e93b7e64c5c87fbd480288c40 (patch)
tree67ddb82626ee9a570581240379f41130d19b7356 /render
parent282629daa133a7ee39185f199781b9b0fed46b27 (diff)
downloadnetsurf-e4952d83ebc71d0e93b7e64c5c87fbd480288c40.tar.gz
netsurf-e4952d83ebc71d0e93b7e64c5c87fbd480288c40.tar.bz2
[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
Diffstat (limited to 'render')
-rw-r--r--render/layout.c14
1 files changed, 10 insertions, 4 deletions
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;
}
}