---
desktop/textarea.c | 9 +++++----
render/font.c | 3 +--
2 files changed, 6 insertions(+), 6 deletions(-)
diff --git a/desktop/textarea.c b/desktop/textarea.c
index 584642d..dcaa2e8 100644
--- a/desktop/textarea.c
+++ b/desktop/textarea.c
@@ -1786,7 +1786,9 @@ static void textarea_setup_text_offsets(struct textarea *ta)
/* Single line text area; text is vertically centered */
int vis_height = ta->vis_height - 2 * ta->border_width;
text_y_offset += (vis_height - ta->line_height + 1) / 2;
- text_y_offset_baseline += (vis_height * 3 + 2) / 4;
+ if (text_y_offset < 0)
+ text_y_offset = 0;
+ text_y_offset_baseline += text_y_offset + (ta->line_height * 3 + 2) / 4;
}
ta->text_y_offset = text_y_offset;
@@ -1894,9 +1896,8 @@ struct textarea *textarea_create(const textarea_flags flags,
ret->show = &ret->text;
}
- ret->line_height = FIXTOINT(FDIV((FMUL(FLTTOFIX(1.3),
- FMUL(nscss_screen_dpi, INTTOFIX((setup->text.size))))),
- FONT_SIZE_SCALE * F_72));
+ ret->line_height = FIXTOINT(FDIV(FMUL(nscss_screen_dpi,
+ INTTOFIX((setup->text.size)/FONT_SIZE_SCALE)),F_72)) * 1.3 ;
ret->caret_pos.line = ret->caret_pos.byte_off = -1;
ret->caret_x = 0;
diff --git a/render/font.c b/render/font.c
index 03c5a36..f594678 100644
--- a/render/font.c
+++ b/render/font.c
@@ -45,8 +45,7 @@ void font_plot_style_from_css(const css_computed_style *css,
css_computed_font_family(css, &families));
css_computed_font_size(css, &length, &unit);
- fstyle->size = FIXTOINT(FMUL(nscss_len2pt(length, unit),
- INTTOFIX(FONT_SIZE_SCALE)));
+ fstyle->size = FIXTOINT(nscss_len2pt(length, unit)) * FONT_SIZE_SCALE;
/* Clamp font size to configured minimum */
if (fstyle->size < (nsoption_int(font_min_size) * FONT_SIZE_SCALE) / 10)
--
1.8.3.2
No comments:
Post a Comment