diff options
author | Michael Drake <michael.drake@codethink.co.uk> | 2018-05-23 11:48:35 +0100 |
---|---|---|
committer | Michael Drake <michael.drake@codethink.co.uk> | 2018-05-23 11:48:35 +0100 |
commit | a58d97a41a6192038573da6862571dc72a560458 (patch) | |
tree | 0efc128007ea0afcc931dede3521012b19723d9f /frontends/monkey | |
parent | 6cabd4cd628833afa32aeb7c614ef153b4a1c985 (diff) | |
download | netsurf-a58d97a41a6192038573da6862571dc72a560458.tar.gz netsurf-a58d97a41a6192038573da6862571dc72a560458.tar.bz2 |
Plotters: Add plot_style_fixed type, and use for font size.
Diffstat (limited to 'frontends/monkey')
-rw-r--r-- | frontends/monkey/layout.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/frontends/monkey/layout.c b/frontends/monkey/layout.c index 7b7223144..0d6a3b4dc 100644 --- a/frontends/monkey/layout.c +++ b/frontends/monkey/layout.c @@ -33,7 +33,7 @@ static nserror nsfont_width(const plot_font_style_t *fstyle, const char *string, size_t length, int *width) { - *width = (fstyle->size * utf8_bounded_length(string, length)) / FONT_SIZE_SCALE; + *width = (fstyle->size * utf8_bounded_length(string, length)) / PLOT_STYLE_SCALE; return NSERROR_OK; } @@ -53,10 +53,10 @@ static nserror nsfont_position_in_string(const plot_font_style_t *fstyle, const char *string, size_t length, int x, size_t *char_offset, int *actual_x) { - *char_offset = x / (fstyle->size / FONT_SIZE_SCALE); + *char_offset = x / (fstyle->size / PLOT_STYLE_SCALE); if (*char_offset > length) *char_offset = length; - *actual_x = *char_offset * (fstyle->size / FONT_SIZE_SCALE); + *actual_x = *char_offset * (fstyle->size / PLOT_STYLE_SCALE); return NSERROR_OK; } @@ -88,7 +88,7 @@ static nserror nsfont_split(const plot_font_style_t *fstyle, const char *string, size_t length, int x, size_t *char_offset, int *actual_x) { - int c_off = *char_offset = x / (fstyle->size / FONT_SIZE_SCALE); + int c_off = *char_offset = x / (fstyle->size / PLOT_STYLE_SCALE); if (*char_offset > length) { *char_offset = length; } else { @@ -104,7 +104,7 @@ static nserror nsfont_split(const plot_font_style_t *fstyle, } } } - *actual_x = *char_offset * (fstyle->size / FONT_SIZE_SCALE); + *actual_x = *char_offset * (fstyle->size / PLOT_STYLE_SCALE); return NSERROR_OK; } |